Stuck on the Clock
For the past couple of months been writing the code to work each device on the board and testing it. But currently I'm stuck.
I've been spinning in place for a while because I can't get the clock to work on the board. I have limited experince with I2C bus devices and making it work on my own is turing out to be a lot harder than I thought.
I'm not 100% sure what is going on. I may have mangled the I2C library, or maybe the internal pullups on the main chip arent stong enough, though I really don't think either of those things are true. If anyone has a lot of experience with I2C devices I'd appreciate any advice. I'm making a trip soon to a friend's electronics lab to see if I can make it work with their pro tools (oscilloscope with a built in I2C decoder).
The good news is the clock is the only thing holding me back at the moment. I found a number of things that wern't working correctly, but I've got them all figured out.
From my notes, things to fix for the final version:
- Enlarge the holes for the breakout header and ISP header.
- Plate the on/off switch case holes.
- Tie VINA HIGH on the power supply.
- Bring 3.3V into the UCAP pin on the AVR. *IMPORTANT*
- Rotate battery header pins 90 degrees.
- Remove a diving trace near the power supply.
- Make push button standard size and flip to bottom of board.
- Clock ????? hardware or software or new chip?
And I think the power draw is going to be low enough to justify the work I did to add a battery. It should run for a few days at the very least not plugged into a computer, which is exactly what I wanted from the beginning. This is the trade off for not having a very expensive wireless module onboard. At least you can take it with you outside or on a trip.
USB and bootloaders
I had some of the same problems I'm having now with the clock with the USB. It turns out that running the AVR at 3.3V requires subtly different wireing and a different PLL setting (that was hardcoded, incorrectly for my case, in a USB library I'm using).
I figured all that out, and now I have simple bootloader that can update new firmware to the board over USB and I can talk with the computer via USB in the main code. Hurray!
I'm using the LUFA library, if anyone is interested. Just watch out for the pound defines for the USB init code if you need different PLL settings.
I keep thinking I'm right on the verge of gettin the clock to work. Just one more day and I'll have it figured out, just like suddently the USB stared making sense. I think "this next thing I'm trying will surly be it". But as of this moment it's still not responding on the bus corrctly.
I won't lie, I'm really, really frustrated right now. I'm so close, but I don't know how long it will take to fix.
In a week I'm going to get the laser cut acrylic put together and I'll show that off. It'll look awesome. Promise.