Hi,
Trying out the "Elapsed Timer" I am observing these issues:
Beeing that I don't have an LCD module, I am trying to write the values in EEPROM and then read back using a PICKit2.
I know the code is working because LED1 is blinking and the rate seems to be good.
My first write is succesful
then trying to write the value for "Seconds" is always 00
trying to write the value for Minutes is always FF (even after a few minutes)
Code:
INCLUDE "DT_INTS-14.bas"
INCLUDE "ReEnterPBP.bas"
INCLUDE "Elapsed_INT.bas" ; Elapsed Timer Routines
LED1 var portc.0
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ClockCount, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts
ENDASM
GOSUB ResetTime ' Reset Time to 0d-00:00:00.00
GOSUB StartTimer ' Start the Elapsed Timer
write 5,3 ; this is working fine.
Main:
IF SecondsChanged = 1 THEN
SecondsChanged = 0
toggle led1
T1CON.0 = 0
write 0,Minutes ; this is always showing 00
write 1,Seconds ; this is always showing FF
'LCDOUT $FE,2, DEC Days,"d-",DEC2 Hours,":",DEC2 Minutes,":",DEC2 Seconds
ENDIF
GOTO Main
Am I missing something?
Thanks
Mike
Bookmarks