probably not if yours fails try thisAm I on the right track to look at them?
Code:DISABLE DEBUG ; syntax = Handler IntSource, Label, Type, ResetFlag? DEFINE Elapsed_Handler TMR1_INT, _ClockCount, asm, yes ; the above define can be used in the INT_LIST macro, if desired (optional) Ticks VAR BYTE ; Counts timer Overflows T1Post VAR BYTE ; Timer1 postscaler Seconds VAR BYTE Minutes VAR BYTE Hours VAR BYTE Days VAR WORD DebugT1PS var byte DebugTCL var byte DebugTCh var byte SecondsChanged VAR BIT ; idicates that the value has changed MinutesChanged VAR BIT HoursChanged VAR BIT DaysChanged VAR BIT GOSUB ResetTime ; initialize the Elapsed Timer Goto OverElapsed ; skip over the routines ' -------------- calc timer reload Constants ------------------------------- ASM T1PS = 1 ; start with 1:1 postscaler TimerConst = ((OSC*1000000)/4/100) ; how many timer ticks will it take while TimerConst > 65400 ; if it's more than the timer can count T1PS = T1PS * 2 ; double the postscaler TimerConst = TimerConst / 2 ; halve the count endw TimerConst = 65536 - TimerConst + 8 ; final reload value _DebugT1PS =T1PS _DebugTCH=TimerConst /256 _DebugTCL = TimerConst - _DebugTCH*256 ; ----------------- ADD TimerConst to TMR1H:TMR1L ------------------------- ADD2_TIMER macro
Bookmarks