Mail Archives: djgpp/1994/10/05/02:46:35
> If you do not actually need more frequent interrupts, but just want to
> accurately read the elapsed time, then another way to do it might be
> to leave the timer interrupting at 18.2Hz, but read the timer's count
> register. By doing this you can calculate how many microsecs have
> passed since the last interrupt, and add that to the interrupt count.
Well, not really. The timer normally operates in a mode whereby the
count counts from 0..(N/2) *twice* between each interrupt. This is so
that it can handle odd counts (0..N/2,0..(N+1)/2) with approximately
50% duty cycle.
You have to reprogram the timer to pulse mode, where it *does* count
from 0..N between interrupts.
- Raw text -