The "Reload(instr. Cycle)" value is important for Long-Term accuracy.
It represents the number of Clock Cycles (instructions) that it takes to Reload the timer.
In the case of Elapsed_INT ... there are 7 cycles between the point where the timer is stopped until it's been reloaded and turned back on again.
7 is also the default number in mister-e's program, but different reload routines may take longer, or shorter times.Code:; ----------------- ADD TimerConst to TMR1H:TMR1L ADD2_TIMER macro CHK?RP T1CON BCF T1CON,TMR1ON ; Turn off timer MOVLW LOW(TimerConst) ;1 1 ADDWF TMR1L,F ;2 1 ; reload timer with correct value BTFSC STATUS,C ;3 1/2 INCF TMR1H,F ;4 1 MOVLW HIGH(TimerConst) ;5 1 ADDWF TMR1H,F ;6 1 endm ; ----------------- ADD TimerConst to TMR1H:TMR1L and restart TIMER1 ---------- RELOAD_TIMER macro ADD2_TIMER BSF T1CON,TMR1ON ;7 1 ; Turn TIMER1 back on endm
hth,




Bookmarks