0 favorites     0 comments    176 visits

See also...


Keywords

electronics
debugging
sump
AVR
ISR
logic analyzer
OLS
dangerous prototypes
interrupt


Authorizations, license

Visible by: Everyone
All rights reserved

176 visits


Cured subject

Cured subject
No more hick-ups to be found. The solution is 'dirty', but works in this case. As the soft-uart only deals with 9600bps, which is rather slow, I made the pin-change interrupt that samples the byte interruptible. The delays introduced by all the other ISRs are minuscule and don't matter ;-)

The other way around would be lethal.

What happened:

The ISR that deals with the LEDs runs in CTC mode, that is the timer value is reset to zero, once a compare match has occurred. Now if other interrupts delay the invocation of said ISR, the timer will have advanced beyond the usual compare match value and will have to wrap around completely. A 16bit timer will need quite a while in this case (2s). In practice the LEDs will shut off for that period. Ouch.

Comments

Sign-in to write a comment.