THIS BLOG HAS MOVED. PLEASE UPDATE ANY BOOKMARKS TO GO DIRECTLY TO WWW.RAISINGGEEKS.COM

Sunday, January 17, 2010

Integrating the components...

Up to this point, I've been working on individual smaller prototypes.
I'd built a WaveShield + Mega prototype, a Liquid Crystal + Duemilanove prototype and I'd built my "modules" for the Control Panel output circuits for the lighted buttons and gauges that had been running on the Duemilanove for days. I also had the shift.in board that was shoved into the joystick that would need to be connected along with the analog axis pots.

It was time to integrate it all - both hardware and software.



The integration of the hardware was easy. I'm getting really fast at wiring these things up. Integrating the code took a bit longer, but I had to remap lots of i/o pins over to the Mega AND I documented them all.

Once I had it together, the audio started skipping. Great.

I started commenting out sections of code to determine what was causing the skipping. As soon as I commented out the shift.in read code, the audio stopped skipping.

I dug into the code and found a delaymicroseconds() call. This call disables interrupts which are used by the WaveShield. I was hoping the shift.in code wasn't timing sensitive, so I changed the call to delay(1) instead AND IT WORKED!

That was the only real integration trouble. The code is getting messy and I suspect I'll be doing some cleanup soon. I'd like to use interrupts & timers more, but I'll save that for later.

No comments: