I've been wondering what it would take...or if anyone has managed to change the Timereload (External Constant), to a variable that can be altered in the main program...
Actually, I would like to load this value from eeprom on startup, but I am at a loss for how to go about this short of learning asm...
;---Reload Timer1------ (T1 asm interrupt handler)
ASM
ReloadTMR1
MOVE?CT 0, T1CON, TMR1ON ; 1 stop timer
MOVLW LOW(TimerReload) ; 1 Add TimerReload to the
ADDWF TMR1L,F ; 1 value in Timer1
BTFSC STATUS,C ; 1/2
INCF TMR1H,F ; 1
MOVLW HIGH(TimerReload) ; 1
ADDWF TMR1H,F ; 1
MOVE?CT 1, T1CON, TMR1ON ; 1 start timer
INT_RETURN
ENDASM
Bookmarks