I finally got around to assembling the dedicated keyboard adapter I made before. I have had the PCBs and components for a while now, but I haven't had the time to assemble it.
When I made the board layout I took the opportunity to get some more experience working with 0402 components, and I also wanted to try to make a PCB edge USB connector. In the end I came up with a very compact design where the keyboard connector is the only thing keeping it as big as it is.
All discrete components are 0402 size, and the MCU is a 7x7 mm QFN package. I also ordered a solder paste stencil from oshstencils.com, which came out very nice as usual. The PCB was ordered from oshpark.com.
Assembly was relatively painless. I did battle a bit with the solder paste application because my solder paste had gone a bit dry. I tried using solder paste from the bottom of the container since that was less dry, but I still got "lumps" in the solder paste. On the third attempt I got it right, and I could place and reflow the components with my hot air rework station.
After doing a quick visual inspection with my microscope and checking for shorts, I needed to program the bootloader into the AVR. Then I could program it with my keyboard software through the USB interface. To do this, you need some kind of AVR programmer. I used my AVR Dragon.
I did mean to build a 1.27mm pitch pogo pin ISP adapter (which would go onto the pads marked "ISP1" on the PCB), but I haven't done that yet. I first attempted to just press a 1.27mm pin header onto the pads to flash the bootloader, but I couldn't get that to work. In the end I just soldered wires to the pads. This worked well enough, after I also realized that I had populated R3 with a capacitor...
To do the actual programming of the firmware, I did two things:
Add my AVR Dragon as an ISP programmer in the Arduino IDE
This is really simple. In the Arduino installation folder, find and open "programmers.txt" and add the following:
dragon.name=Atmel AVR Dragon in ISP mode
The next time you start the Arduino IDE, it will show up under the "Tools" menu:
Program the AVR with the correct bootloader
I want to use the Arudino Leonardo bootloader, since that has the same MCU and clock speed as my board. It's as simple as setting the Arduino Leonardo as the active board:
... and then choose "Burn Bootloader".
After that, I removed my soldered ISP cables since they are not needed anymore. Now my board looks just like a normal Arduino Leonardo to my computer, and I can upload new firmware through the USB interface.