You haven't cleaned up set_up. Just use the following for bank selection:
bcf SSPCON,SSPEN ; Disable Synchronous Serial Port which bank is this in???????????????
bcf SSPCON,SSPEN ; Disable Synchronous Serial Port which bank is this in???????????????
Code:
set_up
;bcf STATUS,RP0 ; RP0 = 0
bsf STATUS,RP1 ; 0 -> Bank 2
clrf ANSEL ; digital I/O
clrf ANSELH ; " " "
;movlw B'00000000' ; To disable comparators
clrf CM1CON0 ; disable comparator
;movlw B'00000000' ; Not necessary?
clrf CM2CON0 ; disable 2nd comparator
;movlw B'00000000' ; Not necessary?
clrf CM2CON1 ; disable 3rd comparator
bcf STATUS,RP1 ; 2 -> Bank 0
bsf STATUS,RP0 ; 0 to 1
movlw B'00001000' ; RA0,RA1,RA2,RA4,RA5,RA6 and RA7 output - RA3 input
movwf TRISA ;
;movlw B'00000000' ;
clrf TRISB ; All PORTB output
movlw B'10000010' ; RC0,RC2,RC3,RC4,RC5,RC6 output - RC1 and RC7 inputs
movwf TRISC ; Set it
bcf STATUS,RP0 ; 1 to bank 0
;bcf STATUS,RP1 ; RP1 = 0 -> Bank 0
bcf SSPCON,SSPEN ; Disable Synchronous Serial Port which bank is this in???????????????
; Turn off all displays and leds
bsf LED_CMN ; Leds off
bsf DISP1 ; Display1 off
bsf DISP2 ; Display2 off
bsf DISP3 ; Display3 off
movlw D'180' ; Init temperature with 180 degrees Celsius
movwf temper ; Put it in temper file
movlw D'40' ; Start timer with 40 minutes
movwf timer ; Put it in timer file
clrf units ; Clear dislay's files
clrf tens ;
clrf hundreds ;
movlw D'255'
movwf buz_length ; Buzzer initial duration
movlw B'11110001' ; Leds initial state (led onoff blinking, up, down and temperature on)
movwf leds_s ; Set leds state
clrf k_pressed ; Zero keys pressed state
clrf Key_deb ; Zero Keys debounce flag
clrf Key_off ; Zero Key off flag
movlw D'255' ; Value to preload to
movwf Led_blink ; Led blink time control
clear the "key pressed" flag file
clear the "not pressed" flag file
goto main
Last edited: