Just want to verify my thinking is correct about the following scenario.
Say I use a 32.768Khz oscillator as a timebase and feed it into an 8 bit counter with a 256 prescaler. That means it should interrupt 128 times a second or once every 7.8125 mS. So once an interrupt occurs the counter stops and my code begins to run. When the code is finished the interrupt is cleared and jumps back to counting.
32.768Khz means that one pulse occurs roughly every 30 uS. Does that mean the interrupt and completion of the code has to happen faster than 30 uS or counts would be lost?
I'm a bit stumped on a way around this. Is there a way to keep track of the overflows instead? Keep the counter running like a frequency divider and do something every 128 overflows? 7.8125 mS should be enough time to do a little math and shiftout 32 bits.
Thanks.
Bookmarks