.:madworm:.'s photos with the keyword: dangerous prototypes
Cured subject
08 Jul 2011 |
|
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 |
|
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 |
|
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.
Sniffing SPI traffic - RLE enabled
Sniffing SPI traffic - RLE enabled
Sniffing SPI traffic - RLE enabled
Sniffing SPI traffic - RLE enabled
07 Jul 2011 |
|
Drilling down...
BTW, I was just zooming in. All the data comes from the same scan.
Openbench logic sniffer
Testing the soft-uart receiver on an ATtiny24
07 Jul 2011 |
|
It seems to work. Now I only have to make the rest of the code live with it in peace. That doesn't work 100% right now. The LED driver interrupt gets upset sometimes.
The entry points of the pin-change ISR are marked with double-pulses, sampling the data is marked by single pulses. Spikes 2-9: sampling the data byte, spike 1: start bit, spike 10: stop bit, spike 11: hmmmm ?!?
OLS - UART decoding
06 Jul 2011 |
|
settings: 9600,8,N,1 de.wikipedia.org/wiki/RS-232
"start bit - 01000110 - stop bit" (LSB first!) equals 0x62
The purple-ish markings don't quite fit time-wise. I've put cursors at the byte boundaries.
OLS pull-up/down wing
15 Dec 2011 |
|
Now fully assembled. Works ok for me up to 100MHz + RLE. 200MHz sampling rate + RLE needs stronger pull-down resistors. With RLE turned off the 'noise' on unused channels creeping over from a used one is tolerable (for me at least).
A very interesting discussion about the problem this board tries to solve.
OLS pull-up/down wing
15 Dec 2011 |
|
Now fully assembled. Works ok for me up to 100MHz + RLE. 200MHz sampling rate + RLE needs stronger pull-down resistors. With RLE turned off the 'noise' on unused channels creeping over from a used one is tolerable (for me at least).
Preparations for brain surgery
Preparations for brain surgery
OLS - UART sniffing
OLS - UART sniffing
06 Jul 2011 |
|
Just testing the analyzer a bit.
Unconnected probes pick up noise quite a lot.
Jump to top
RSS feed- .:madworm:.'s latest photos with "dangerous prototypes" - Photos
- ipernity © 2007-2025
- Help & Contact
|
Club news
|
About ipernity
|
History |
ipernity Club & Prices |
Guide of good conduct
Donate | Group guidelines | Privacy policy | Terms of use | Statutes | In memoria -
Facebook
Twitter