.:madworm:.'s photos with the keyword: interrupt

Cured subject

08 Jul 2011 192
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.

Mental illness in microcontrollers

08 Jul 2011 211
The top signal shows the premature death of the ATtiny24's TIM1_COMPA_vect. In hindsight the explanation is trivial, but I didn't suspect that cause until very late in the debugging process - as usual.

The patient is well again !

08 Jul 2011 157
From top to bottom: a) Interrupt servicing the LED drivers with PWM pulses. It only runs when the edges need to change and takes very little time. But it is crucial that its timing is 100% spot on. b) LED driver enable signal produced by the ISR. c) pin-change interrupt that reads incoming serial data @9600. d) pulses indicate when the bit are sampled, which is tuned by inserting fixed delays. e) incoming serial data. f) status LED showing something I can't remember right now.

This trigger point looks right

19 Apr 2012 136
This one should have (and has) triggered on a positive pulse of 103µs length.

Confused trigger

19 Apr 2012 117
This one should have triggered on a positive pulse shorter than 16.5µs.

Confused trigger

19 Apr 2012 127
This one should have triggered on a negative pulse of 14.0µs length.

MIBAM - OK ISR run time

19 Apr 2012 161
Now the ISR is short enough as not to interfere too much with the least significant bits.

MIBAM - bad ISR runtime

19 Apr 2012 161
The ISR takes too long and messes up the timing of the least significant bits.

MIBAM - delayed interrupt

19 Apr 2012 161
Once in a while the interrupt gets delayed. The green pulse-train shows when and how long the ISR runs. This causes fluctuations in brightness.

MIBAM - trying to get it to trigger

MIBAM

19 Apr 2012 161
Playing with the persistence setting. It is variable, but unfortunately the old traces don't fade out. They just vanish after a timeout.

Confused trigger

19 Apr 2012 156
This one should have triggered on a positive pulse longer than 177µs.

Confused trigger

19 Apr 2012 147
This one should have triggered on a positive pulse shorter than 73µs.

20 items in total