In the Elapsed include:
Darryl talks about a post-scaler. Timers 1, 3 and 5 have none for a 18F44K22?Code:... ' -------------- 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 ...
Neither does Timer 0, only Timers 2,4 and 6 have pre and post-scalers.
Robert




Bookmarks