I had a quick look... a guess: since the interrupt handler is polling
the counter that triggers the interrupt, the mcu may spend its whole
time in the interrupt handler. Could you time the interrupt handler? Are
you sure that the delay loop is really 'stuck'? I'd rather bet that it
crawls because 32 bits calculations in the AVR are much slower than 8
bits calculations. If at the same time the main loop gets mcu time only
once in a while, that would give the result you get (guessing again!).
Also can't you hit overflow situations in the polling code? You perform
32 bits calculations when polling the 16 bits counter, I'm surprised
that the compiler does not complain about these. Do you compile with -Wall ?
Regards,
Bernard
Brian Neltner wrote:
Sorry, typo. I was giving example code, not a literal copy of my source.
[snip]
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list