Categories: ATmega32u4, MSFS2020

Component selection and schematic for a custom ATmega32u4 PCB

Feb 26, 2023: While this information is still accurate I would never, ever, do an ATmega32u4 PCB anymore. Instead I use an RP2040 chip. So much easier to find, cheaper, and easier to deal with.

I built a custom PCB that replicates the TBM930 de-ice panel for use with Microsoft Flight Simulator 2020 and Mobiflight. This is part 1 of a series where I walk through how I managed to do it with an ATmega32u4 directly on the PCB instead of relying on an external Arduino board.

Why an ATmega32u4 (the chip used on the SparkFun Pro Micro) instead of the ATmega2560 (the chip used on the Arduino Mega 2560)? Easy: onboard USB. The 2560 doesn’t have onboard USB and if you look at the schematic for the Mega 2560 you’ll see it also has… a 32u4 to handle the USB communication.

The chip itself has, as you’d expect, a full datasheet. But if you’re like me you just want to know what decoupling capacitors and whatnot are required and how to lay them out on a PCB. Sadly that isn’t really explained in the datasheet so I wound up doing a lot of reading in random forums of people trying to do similar custom boards and looking at the schematics for the Pro Micro and Arduino Leonardo. Distilling all that down got me this schematic:

Schematic illustrating an ATmega32u4’s basic connections.

Important things to note:

In addition the incoming USB port has components to ensure proper power and USB operation. I wanted to include ESD protection but JLCPB didn’t have any available as basic parts so I left it out.

Necessary components for the USB input to an ATmega32u4.

Of note are the 22Ω resistors on the D+ and D- lines.

The Arduino bootloader expects the 32u4 to have an external oscillator providing the clock so that also needs to be included in the schematic:

Necessary components for an external crystal oscillator with an ATmega32u4.

The oscillator is 16MHz and per the datasheet I added 20pF capacitors. 22pF capacitors should work too but 20pF is what I had on hand so that’s what I used.

Finally there has to be a way to get the bootloader onto the chip. I did that by exposing an AVR-ISP header and reset switch on the board. The reset switch really wasn’t necessary but it was easy to include so I added it. The reset circuit design is pulled directly from the chip’s application notes (see figure 2-1).

AVR-ISP and reset circuit for an ATmega32u4.

That’s all it takes! When I first looked at the schematics for the Sparkfun Pro Micro I found it pretty intimidating (and frankly quite messy) but once I walked through it the actual required components aren’t that bad.

The complete schematic is available in GitHub. To see how this got laid out on the PCB check out part 2 of the series.

Article info



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.