Can I change the interrupt hertz from 100 to 1000 and then have 0.001 resolution?
Can I change the interrupt hertz from 100 to 1000 and then have 0.001 resolution?
You can.
You would need to change the TimerConst so that it interrupts at 1khz.
You can use mister-e's calculator for that.
Change the Ticks variable to a WORD.
Then in the ClockCount routine, change to this ...Happy Holiday's,Code:Ticks = Ticks + 1 if Ticks = 1000 then Ticks = 0 Seconds = Seconds + 1 ; etc.
DT
Great. I downloaded the calculator and am using the 'timer helper' module. I am using a 20 Mhz OSC. I am not too sure as to what I need for a reload number. I enter in 1 Khz for the interrupt frequency. Using 10 for the reload number I get 60546 for the preload result. Hex is then ec82. If this correct? I am going to reverse engineer using your numbers for 0.01 resolution to see if its right. I am at the in-laws without my scope so I can't check this today.
Thanks for the help
Toby
Very good.
Elapsed-18 uses an 8-instruction reload.
So, 60544 (EC80) should be a little more accurate.
Can't help with the in-laws ... Sorry.
<br>
DT
Bookmarks