# Atmega32u4 Breakout

## Intro

![](https://cdn-learn.adafruit.com/assets/assets/000/030/454/medium800/microcontrollers_296-01.jpg?1454987577)

## About the Atmega32u4 Breakout board+

We like the AVR 8-bit family and were excited to see Atmel upgrade the series with a USB core. Having USB built in allows the chip to act like any USB device. For example, we can program the chip to 'pretend' it's a USB joystick, or a keyboard, or a flash drive! Another nice bonus of having USB built in is that instead of having an FTDI chip or cable (like an Arduino), we can emulate the serial port directly in the chip. This costs some Flash space and RAM space but that's the trade-off.

 

The only bad news about this chip is that it is surface mount only (SMT), which means that it is not easy to solder the way the larger DIP chips are. For that reason, we made a breakout board. The board comes with some extras like a fuse, a 16mhz crystal, USB connector and a button to start the bootloader.

## Why not use a Teensy

We also carry a similar board from PJRC called the [Teensy](http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=199 "Link: http://www.adafruit.com/index.php?main\_page=product\_info&cPath=16&products\_id=199") . The Teensy uses the same chip so you may be wondering, why did we design a different-but-still-basically-the-same board? We've used the Teensy in a few projects and like it a lot but there are a few details that we wanted to change. We wanted…

 
- …a bootloader that would work with **avrdude** since that is our preferred software
- …another LED, for power-good indication
- …a 500mA fuse on the USB power-source pin
- …mounting holes so we could attach it easily
- …reprogramming ISP header so we could program the board directly without the bootloader
- …a larger reset button
- …all the pins broken out for use with a breadboard
- …open source bootloader that works with AVRdude

 

That doesn't in any way mean that it is better or replaces the Teensy. Here are some reasons we will still use the teensy for many projects

 
- It's **really really** small. A third the size of this breakout
- The bootloader that is programmed in uses only 512 bytes (instead of 2K)
- It works nicely with Teensyduino and auto-resets right before programming

![](https://cdn-learn.adafruit.com/assets/assets/000/030/455/medium800/microcontrollers_296-00.jpg?1454987582)

# Atmega32u4 Breakout

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/009/908/medium800/microcontrollers_atmega32u4_med.jpg?1396899349)

The breakout is almost completely assembled. We don't solder on the header or 6-pin ISP connector since we find it's easy to do but hard to undo, in case you want to put different headers on, or just connect up wires directly.

The board ships with a strip of header, you can simply break the header into two pieces and place them in a breadboard.

![](https://cdn-learn.adafruit.com/assets/assets/000/009/909/medium800/microcontrollers_header_t.jpg?1396899363)

Then place the board on top and solder it in place.![](https://cdn-learn.adafruit.com/assets/assets/000/009/910/medium800/microcontrollers_headerplaced_t.jpg?1396899375)

![](https://cdn-learn.adafruit.com/assets/assets/000/030/453/medium800/microcontrollers_296-01.jpg?1454987386)

# Atmega32u4 Breakout

## Design

[If you're using windows, you will need an **inf** driver file, you can download it below (in the **Downloads** section)](../../../../atmega32u4-breakout/download)

# Design Specifications

This breakout board is designed to make it easy for you to get started with the Atmega32u4, a USB-native 8 bit AVR microcontroller. We tried to keep the design simple, while taking care of all the details so that you can focus on your project's firmware and hardware.

## Microcontroller

The main chip is an ATmega32u4, an 8 bit AVR-core processor which has the bonus of a USB core built in. This makes writing USB native programs such as serial ports, mouse/keyboard, mass-storage-controller, MIDI, etc very easy. The chip has 32K of flash and 2.5K of RAM. The microcontroller is clocked at 16 MHz with an on-board crystal.

## Power

The board is powered by the USB port at 5V. There is a 500mA polyfuse to protect your computer from a shorted circuit. If you'd like to run the board off of another voltage, you can do that by cutting the **VCC** solder jumper bridge underneath and connecting an external voltage to pin #2 of the ISP header. Note that running the board at 3.3v @16mhz is considered overclocking. We do it for prototypes and it seems to work fine but it's out of spec!

There is a 3V pin from the microcontroller's internal regulator (USB signals are at 3V) you can use this for maybe 10mA or so, it might work as a reference voltage).

## Pinout

Pins are labeled on the silkscreen, but for additional information, Johngineer has created [a nice pinout diagram](http://www.adafruit.com/datasheets/af_at32u4bb_pinout.pdf "Link: http://www.adafruit.com/datasheets/af\_at32u4bb\_pinout.pdf") that is helpful for using this board.

![](https://cdn-learn.adafruit.com/assets/assets/000/009/911/medium800/microcontrollers_8255357374_9f76b8de8a_o.png?1396899422)

# USB Development

The very nice thing about this chip is the USB core built in which makes USB-device development easy. What makes it even easier & better is [the full USB stack already written for you by Dean Camera](http://www.fourwalledcubicle.com/LUFA.php) . Called ["LUFA"](http://www.fourwalledcubicle.com/LUFA.php) , the package comes with tons of working examples for all sorts of USB devices and its completely open source. We use the firmware as a 'starting point' which we then expand upon. Please check it out and if you find it useful consider donating time (fixing bugs, improving documentation) or funds to Dean.

# Atmega32u4 Breakout

## Using with AVRDude

# AVR109 Bootloader & AVRdude

You can tell the bootloader is active when the **red 'Boot' LED pulses/breathes** The board will then show up as a Serial or COM port, and you can use **avrdude** to program it. The 'programmer name' is **avr109** so for example, to test you should run **avrdude -p m32u4 -P COM3 -c avr109** which will initialize the bootloader.

![](https://cdn-learn.adafruit.com/assets/assets/000/030/445/medium800/microcontrollers_avr109.gif?1454985596)

You can find the serial port COM# in the Device driver, or for mac/linux users run **ls /dev/cu.usb\*** to list all usb serial devices

![](https://cdn-learn.adafruit.com/assets/assets/000/030/446/medium800/microcontrollers_comport.png?1454985641)

The bootloader will time out eventually (after about 10 seconds) Because we are not using a USB/serial converter, bootloading is tremendously fast, we can program a full chip in under 2 seconds!

The bootloader takes up the last 4K of FLASH, so be aware that you will only have 28K instead of 32K. We have found that this isn't very constricting as 28K is still plenty. If you'd like more space, you can always use the 6-pin ISP connector and an AVR programmer (which will delete the bootloader)

If you ever want to disable the bootloader you can cut the bottom 'HWB' jumper trace. This will disconnect the 'hardware bootloader' pin, you can then use the button as a plain reset button. For the first few runs of this board we set the fuses to still use the bootloader even with the HWB jumper cut, if you want to get rid of the bootloader, please set the fuses to remove the BOOTRST fuse. Sorry!

# Atmega32u4 Breakout

## Arduino IDE Setup

The first thing you will need to do is to download the latest release of the Arduino IDE. You will need to&nbsp;be using **version 1.8** or higher for this guide

[Arduino IDE Download](http://www.arduino.cc/en/Main/Software)
After you have downloaded and installed **the latest version of Arduino IDE** , you will need to start the IDE&nbsp;and navigate to&nbsp;the **Preferences** menu. You can access it from the **File** menu in _Windows_ or _Linux_, or the **Arduino** menu on _OS X_.

![](https://cdn-learn.adafruit.com/assets/assets/000/041/549/medium800/flora_prefs.png?1494204209)

A dialog will pop up just like the one shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/108/455/medium800/trinket_arduino-preferences-before.png?1643387570)

We will be adding a URL to the new **Additional Boards Manager URLs** option. The list of URLs is comma separated, and _you will only have to add each&nbsp;URL once._&nbsp;New Adafruit boards and updates to existing boards&nbsp;will automatically be picked up&nbsp;by the Board Manager each time&nbsp;it is opened. The URLs point to index files that the Board Manager uses to build the list of available & installed boards.

To find the most up to date list of URLs you can&nbsp;add, you can visit the list of [third party board URLs on the Arduino IDE wiki](https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls#list-of-3rd-party-boards-support-urls). We will only need to add one URL to the IDE in this example, but _ **you can add multiple URLS by separating them with commas** _. Copy and paste the link below into the&nbsp; **Additional Boards Manager URLs** option in the Arduino IDE preferences.

### `https://adafruit.github.io/arduino-board-index/package_adafruit_index.json`
![](https://cdn-learn.adafruit.com/assets/assets/000/108/456/medium800/trinket_arduino-preferences.png?1643387643)

Here's a short description of each of the Adafruit supplied packages that will be available in the Board Manager when you add the URL:

- **Adafruit AVR Boards** - Includes support for Flora, Gemma, Feather 32u4, ItsyBitsy 32u4, Trinket, & Trinket Pro.
- **Adafruit SAMD Boards** - Includes support for Feather M0 and M4, Metro M0 and M4, ItsyBitsy M0 and M4, Circuit Playground Express, Gemma M0 and Trinket M0
- **Arduino Leonardo & Micro MIDI-USB** - This adds MIDI over USB support for the Flora, Feather 32u4, Micro and Leonardo using the [arcore project](https://github.com/rkistner/arcore).

If you have multiple boards you want to support, say ESP8266 and Adafruit, have both URLs in the text box separated by a comma (,)

Once done click **OK** to save the new preference settings. Next we will look at installing boards with the Board Manager.

Now continue to the next step to actually install the board support package!

# Atmega32u4 Breakout

## Using with Arduino

Once you have the Arduino IDE Set up and you've installed the board manager package, you can select the **Adafruit 32u4 Breakout** from the boards list

![](https://cdn-learn.adafruit.com/assets/assets/000/030/447/medium800/microcontrollers_selectboard.png?1454985794)

Then select the port

![](https://cdn-learn.adafruit.com/assets/assets/000/030/448/medium800/microcontrollers_selectport.png?1454985810)

Create a new sketch:

```auto
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(7, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
```

And upload it! You should see the red LED blink once a second

Danger: 

That's it, you can now use the board from the Arduino IDE, you can use this pinmapping guide to help line up which pin is which:

![](https://cdn-learn.adafruit.com/assets/assets/000/030/449/medium800/microcontrollers_8255357374_9f76b8de8a_o.png?1454986027)

# Using it with Teensyduino

If you'd like to use Teensyduino type programs, you can do that too, by using the TeeOnArdu board plugin. Use the board manager, and select the TeeOnArduino package and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/030/450/medium800/microcontrollers_teeonardu.png?1454986125)

Then in the board menu, select **TeeOnArdu (Leonardo on TeensyCore)**

![](https://cdn-learn.adafruit.com/assets/assets/000/030/451/medium800/microcontrollers_teeonarduinole.png?1454987056)

You can then select which USB device core you want to use

![](https://cdn-learn.adafruit.com/assets/assets/000/030/452/medium800/microcontrollers_type.png?1454987317)

Danger: 

# Atmega32u4 Breakout

## Download

## Download

- [EagleCAD PCB files on GitHub](http://github.com/adafruit/Atmega32u4-Breakout-Board)
- [Fritzing object available in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library)
- [The LUFA USB-stack website](http://www.fourwalledcubicle.com/LUFA.php)
- [Our minor fork to the LUFA core](http://github.com/adafruit/lufa-lib) - this is where our AVR109 bootloader lives (in Bootloaders/CDC)

[Download Windows Driver atmega32u4cdc.inf](https://learn.adafruit.com/system/assets/assets/000/030/441/original/atmega32u4cdc.inf?1454985290)
# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/035/683/medium800/microcontrollers_schem.png?1473702355)

# Fabrication Print

Dims in inches

![](https://cdn-learn.adafruit.com/assets/assets/000/035/684/medium800/microcontrollers_fabprint.png?1473702374)


## Related Guides

- [Adding Custom Boards to the Arduino v1.6.3 Board Manager](https://learn.adafruit.com/adding-custom-boards-to-the-arduino-v1-6-board-manager.md)
- [Debug Arduino Uno/ATmega328P with Adafruit CH552 QT Py and debugWire](https://learn.adafruit.com/debug-arduino-uno-atmega328p-with-adafruit-ch552-qt-py-and-debugwire.md)
- [Adafruit I2C QT Rotary Encoder](https://learn.adafruit.com/adafruit-i2c-qt-rotary-encoder.md)
- [TV-B-Gone Kit](https://learn.adafruit.com/tv-b-gone-kit.md)
- [Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports](https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports.md)
- [May Pad Macropad with the KB2040, KMK, and CircuitPython](https://learn.adafruit.com/maypad-macropad-with-the-kb2040-kmk-and-circuitpython.md)
- [Kitty's Flowers - Bluetooth Wearable Brooches - Art by Physicist](https://learn.adafruit.com/flowers-bluetooth-wearable-brooches-art-by-physicist.md)
- [Adafruit Feather RP2040 Adalogger](https://learn.adafruit.com/adafruit-feather-rp2040-adalogger.md)
- [Adafruit TCA8418 Keypad Matrix and GPIO Expander Breakout](https://learn.adafruit.com/adafruit-tca8418-keypad-matrix-and-gpio-expander-breakout.md)
- [Adafruit MatrixPortal M4](https://learn.adafruit.com/adafruit-matrixportal-m4.md)
- [Adafruit Feather RP2040 ThinkInk](https://learn.adafruit.com/adafruit-rp2040-feather-thinkink.md)
- [How to Scan and Detect I2C Addresses](https://learn.adafruit.com/scanning-i2c-addresses.md)
- [Adafruit PiCowBell HSTX DVI Output](https://learn.adafruit.com/adafruit-picowbell-hstx-dvi-output.md)
- [Arduino "Hunt The Wumpus"](https://learn.adafruit.com/arduino-hunt-the-wumpus.md)
- [Adafruit 4-Channel ADC Breakouts](https://learn.adafruit.com/adafruit-4-channel-adc-breakouts.md)
