First off, I want to send a huge thank you to Joe Grand, creator of the DefCon badges. Last year was my first year at DefCon, and I had a TON of fun hacking the DC16 badge with a POV and PWM display. This year I had a bit more time (and a windows VM to use CodeWarrior), also I packed 15 pounds of electronics crap into my backpack. I've never worked with DSP or DSC, so this was new stuff for me, and I'm very glad I got in to it! I didn't see the sneak peak post until it was too late to buy a 3.3v usb->serial, or the jtag dev kit, fortunately I picked up one of the parallax convention kits which has a propplug and worked perfectly.
Fffft!

Feautes of this hack:
- 15 LED FFT output (from 32 audio samples) - up from 8 samples in original firmware
- Crappy PWM output for the 15 LEDs - 4 bits of software interrupt driven PWM. It was fast enough to do 50hz @ 8 bits though, but I opted for faster refresh and lower res.
- Selective display of stronger frequencies (otherwise all of the LEDs
light up and you can't really tell) but can show multiple frequencies.
How I got it to work:
- Getting FFT n=32 was a pita, the project failed to compile with
higher values of n, due to out of ram problems. Turns out, there was a
good sized chunk allocated in the linker file for dynamic memory,
which I think is for the memory bean, however the dsp function bean
doesn't require the memory bean if you don't use the allocate methods,
and uncheck some box in the properties. So I disabled the memory bean,
and set the mem size for dynamic memory to zero in the linker file,
and it let me get n=32. This worked great, and I have a feeling that
it might be possible to use code ram for larger sizes, and do more
cool stuff.
- I think when I stepped up the running clock speed using the PLL,
the timers got out of whack. Tmr0 seemed to run faster than the 8khz
sample rate it was set for. I have a feeling that if it was sampling @
8khz, voice would have had better representation on the 15 LEDs. My
serial connector broke just as I was trying to test with different
values :-(
- I wired up the last 2 LEDs on Sunday, and forgot to add them to my
software PWM loop (tmr1), Oops! Everything else is there I think.
- Using thick wire for pins = fun! Actually, I'm very glad these had
a 0.8mm pitch, the 0.5mm stuff kills me, and I didn't have smaller
wire. Flux is everywhere.

Source CodeWarrior Project & Files WARNING: this was a quick ugly hack, and the code looks like it!
About me: I'm a software engineer, but always had a love for EE. I've started a hackerspace in Santa Cruz: Bitsmasher.