|
Re: Timer0 Interrupt Behaviour
The timer gets incremented at 10 MHz. However, if it's an 8 bit timer, it will overflow and interrupt after 256 counts, assuming no prescale. If you want it to interrupt faster than this, you preload it with some value everytime it overflows. If you load it with 127, then it would overflow after only 128 more counts. So if you wanted it to interrupt at 10MHz, you'd preload it with 255. Except you'd have to take time to get in and out of the interrupt handler.... Probably, you could get in and out of the handler fast enough to have 100 kHz interrupts, and have your processor doing absolutely nothing else and giving you the dreaded Red Light of Death.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|