Posts Tagged ‘Altbros’

WTPA v0.95 Gremlins

Saturday, December 6th, 2008

The lone and level sands stretch far away from this nasty Nas, I’m afraid:

Not that you can tell from gazing on this benighted silicon Ozymandias, but no pretty waveforms will happen tonight. It’s not a total loss; there’s some badassery that came through and TON of code, but since I said I’d post today here’s the breakdown:

The body of the code is done for both MCUs, at least at first blush, and the ISRs are now based on the parallel interfaces. The LEDs look crazy hot. Messy little resistors and whatnot are dutifully appearing on the board. The square waves are almost square.

The bad news is that all the old timers who I didn’t pay attention to were right — UART communication on internal RC oscillators is dodgy at best. The real (and unforseen) challenge of the last 16 hours has been massaging the serial link between the two MCUs enough that it works. It limps along now but it sucks. My studied conclusion is that the second MCU really needs its own crystal, and it might as well be at a UART-friendly frequency.
I probably have some laying around somewhere, and will dig them (and exacto blades) out this weekend.

Other fun bugs and riders of the nitpick train include:

The AVR toolchain doesn’t seem to be very excited about the 48p/88p/168p MCUs, and although you can fool it, doing so raises the “bad idea” error flag. Further, the STK500 seems to only want to program the old-ass m168s I dug out to rectify this problem ONE TIME, before getting totally weird. This is a good one: These parts are socketed in the STK, mind, and the fuse bits remain totally unchanged through this whole process. You put code onto the part just fine and boom, it becomes unprogrammable. I did this THREE times. Furthermore, reading the Vtarg on the STK500 shows 6+ Volts, and the device times out when you try to communicate with it. Say what?
I started shopping for a new STK, until further fiddling revealed you can a.) physically pull the RESET pin to ground on the socketed target device using an alligator clip (or stream of foul language) which allows it program just fine OR you can socket and connect to another WORKING part, and move the Vtarg down to 3v, whereupon the old “broken” part works just fine again. Gremlin central.

Writing the code was, thankfully, pretty straightforward and I discovered a kickass feature in avr-libc: ISR_ALIASOF() — this reduced the accumulated ISR code to half the size — thus doubling its beauty.
Finally, a point of consideration: Naming an electonic device on your website “Where’s The Party At” makes for no small amount of schoolgirlish giggling when looking at your keyword referrals in Google Analytics. In keeping, I have decided to name my next piece “Hot Hipster Tang For Altbros”.