AVR programming
I've been geeking out on electronics a lot recently. Last week full of rehearsals made me put a lot of thought into the question of what I would be doing if I actually had all that time to myself. Slowly over the course of the week I collected all my gear (multimeter, soldering tools, AVR programmer(s), etc) onto one table. Sunday night I set out to write code for the AVR and upload it from my Mac (something I had always had to do from a PC).
Roughly, the process of getting this to work included:
- Compiling a custom avr toolchain, including binutils, gcc-3.4, and avr-libc. The new avr-libc is rad, but the MacOS X avr toolchain package I installed had ancient versions of everything. If you're doing this yourself, compile it all from scratch.
- Compiled uisp from scratch. I also compiled avrdude, which looks cool. I simply managed to get uisp working first.
- Discovering that my USB-to-Serial adaptor (purchased from Outpost.com (a division of Frys)) is busted. Replacing it, and a burned out soldering iron from Fry's.
- Discovering my new soldering iron is defective. There's a reason I stopped shopping at Fry's years ago.
Well, last night I used this fancy new setup to pulse an LED using the AT90S2313 PWM. Hooray! With a working development environment I can now get back to work on all the fun electronics projects that have been clogging my brain.
I also discovered that my big bag of Atmel microcontrollers is hopelessly out of date. I've been working through the batch I bought a couple years ago. All the new models use less power, have internal RC oscillators (no crystal!) The model that replaces the AT90S2313 (the ATiny2313) has three PWM channels, among other nifty improvements. I'm going to pick up a handful today if I can.