koky
Full Member level 2
pic12683
I have make a crepuscolar timer ( 8 ours), it go right for 3/4 days, after the time change, 1 ours or 3 ours instead of 8 ours. At start_up i load the time from eeprom, is possible that the ram value change in the time ?? in all routine i have not modified the value but only copied in W register.
the interrupt routine is this:
;--------------------------------
ORG 0x0000 ; start code
nop ;
goto Start ;
;----------------------------------------------------------------->Interrupt<
ORG 0x04 ;
movwf intw ;
swapf STATUS,W ;
clrf STATUS ; Bank0
movwf ints ;
movf PCLATH,W ;
movwf intp ;
clrf PCLATH ; ISR in pag0
movf FSR,W ;
movwf intf ;
;--------------------------------
btfsc PIR1,TMR1IF ; timer1
call Timer_1 ;
;--------------------------------
movf intf,W ;
movwf FSR ;
movf intp,W ;
movwf PCLATH ;
swapf ints,W ;
movwf STATUS ;
swapf intw,F ;
swapf intw,W ;
retfie ;
;--------------------------------
register allocation
ints equ 0x7c ; interrupt copy status
intp equ 0x7d ; interrupt copy pclath
intf equ 0x7e ; interrupt copy fsr
intw equ 0x7f ; interrupt copy W
I have make a crepuscolar timer ( 8 ours), it go right for 3/4 days, after the time change, 1 ours or 3 ours instead of 8 ours. At start_up i load the time from eeprom, is possible that the ram value change in the time ?? in all routine i have not modified the value but only copied in W register.
the interrupt routine is this:
;--------------------------------
ORG 0x0000 ; start code
nop ;
goto Start ;
;----------------------------------------------------------------->Interrupt<
ORG 0x04 ;
movwf intw ;
swapf STATUS,W ;
clrf STATUS ; Bank0
movwf ints ;
movf PCLATH,W ;
movwf intp ;
clrf PCLATH ; ISR in pag0
movf FSR,W ;
movwf intf ;
;--------------------------------
btfsc PIR1,TMR1IF ; timer1
call Timer_1 ;
;--------------------------------
movf intf,W ;
movwf FSR ;
movf intp,W ;
movwf PCLATH ;
swapf ints,W ;
movwf STATUS ;
swapf intw,F ;
swapf intw,W ;
retfie ;
;--------------------------------
register allocation
ints equ 0x7c ; interrupt copy status
intp equ 0x7d ; interrupt copy pclath
intf equ 0x7e ; interrupt copy fsr
intw equ 0x7f ; interrupt copy W