Prototype PCBs are here!
Today I received the prototype run from smart-prototyping. To start, here's a nausea inducing unboxing video where I attempt to open a box with one hand:
Of course the first thing I tried to do was to plug one into my computer. Once I plugged it in I expected to see at Atmel device on my USB bus. So I plugged it in, navigated to the thing that shows what's plugged into my USB bus... and it wasn't there!
(Warning, long description of my troubleshooting process ahead.)
After I stopped panicking I started to work on figuring out what was wrong. First up, get my meter out and check everything over. All the resistors measured what I expected. No short between VCC and GND. The RESET line was not connected to GND. I had +5v everywhere I expected to. My UCAP capacitor didn't have any voltage. So I know that everything measures out the way I expect, but my MCU isn't initializing USB. What could be wrong?
My gut tells me it's probably the crystal, so I started debugging there. I first popped off the crystal and the caps, assuming that maybe the connection was bad:
However, those looked fine, and while resoldering I made sure that it had a good connection. OK, it's gotta be something else right? So I started looking at all my caps, wondering if I could tell them apart. Here's a picture of a 1uf cap sitting next to C1:
Well, that isn't going to work. Every 0805 cap on this board look exactly the same! So I started measuring out board capacitance. Between VCC and GND I had a total of 2.8uf, well within tolerances. That's enough capacitance for the MCU to run stable without exceeding the 20uf limit. While I had the crystal's caps off I checked those and they were each 10uf, exactly what my schematic says they should be. Even UCAP has the right amount of capacitance.
At this point I was stumped. This was the same controller designed I used successfully in the my 1% board, the Clueboard, and the ADB converter. What could be wrong? It was time to compare it with a working circuit part by part. I went through every part on the Clueboard, comparing it against the Monarch, and all seemed to be in order. As I went down the list I found only matches, no discrepancies. Finally, I came to the last 3 parts on the Clueboard, the crystal and corresponding caps. It was here, when I was sure there wasn't even a single difference, that I found the problem.
The monarch has 10uf caps connected to the crystal, while the Clueboard had 10pf caps.
Luckily I had some 10pf caps on hand, and I was able to swap those in:
Once I did that I plugged the board in and it showed up! Success! I celebrated by loading the firmware:
Creating load file for Flash: monarch.hex
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature monarch.elf monarch.hex
dfu-programmer atmega32u4 erase --force
Erasing flash... Success
Checking memory from 0x0 to 0x6FFF... Empty.
dfu-programmer atmega32u4 erase
Checking memory from 0x0 to 0x6FFF... Empty.
Chip already blank, to force erase use --force.
dfu-programmer atmega32u4 flash monarch.hex
Checking memory from 0x0 to 0x54FF... Empty.
0% 100% Programming 0x5500 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
0% 100% Reading 0x7000 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
Validating... Success
0x5500 bytes written into 0x7000 bytes memory (75.89%).
dfu-programmer atmega32u4 reset
I'd love to say I'm typing this on a monarch, but sadly not yet. I was, however, able to bridge some switch pins and make characters appear. The Monarch is alive and nearly ready for its production run! Tomorrow I will swap out the crystal caps on the remaining PCB's and then send 4 of them to koalapear. We are very close!