Installing Arduino Bootloader on an ATmega32u406 Jun 2015
The Atmel ATmega32u4 gained popularity with its use in the Arduino Leonardo, due to the built-in USB support, which made an additional chip unnessary for that purpose. I’ve had a couple of ATmega32u4s in storage for a while, so I decided to try and solder the chip and make an Arduino Leonardo compatible board out of it. Both Adafruit and Sparkfun have ATmega32u4 breakout boards that they sell, and I have used their designs as a reference. Why bother? Because if you are developing an AVR based board with USB, this chip is worth looking at, especially since you can use the existing Leonardo bootloader.
The first step of course, is to solder the darn chip. I used a QFP 44 breadboard adapter, and started by tinning the pads.
Next, I soldered the chip. Diagonal corner pins first, to fix the chip on the board. Used plenty of flux, and a magnifier loupe (getting old!).
After a close inspection, checking for shorts, etc., I assembled the circuit on a breadboard. The schematic can be found here.
For the USB connection, I cut an old USB cable. The color scheme for the wires is shown below. But I (painfully) discovered that D+ and D- are switched some times.
After setting up the breadboard, I used an ISP programmer (Sparkfun, based on usbtiny) and avrdude to first check the fuses on the chip - to see if the connections are alive, basically:
Next, I got the Sparkfun bootloader and downloaded it to the chip as follows:
Now, after unhooking the ISP programmer and connecting the USB cable to my computer (running OS X), I got:
Yay - it’s alive! Now I opened up the Arduino IDE, selected Arduino Leonardo as the board and the above serial port. I put an LED on D2 and wrote a blink sketch which also printed debug statements on Serial. To upload the code to the board, I had to hit upload, and then set RESET of the chip to GND momentarily. And it just worked.
Thanks to Ayush Sagar for pointing out to me that the D+/D- wire colors in USB are unreliable!
- Atmel ATmega32u4 data sheet.
- Adafruit ATmega32u4 breakout board documentation.
- Sparkfun ATmega32u4 breakout board documentation.