Electronic – Differences between atmega32u2 and atmega32u4
atmega
What are most important differences between ATMega32u2 and ATMega32u4?
Best Answer
Compared to the u2, the u4 has:
More RAM (2.5k vs. 1k)
More pins (48 vs. 32)
Analog-to-digital converters instead of just analog comparators
Low frequency crystal option instead of full swing crystal option
An I2C interface.
To answer this, I did a DigiKey search for each part number and compared the result tables. This is easier than comparing the datasheets, although datasheets are the most accurate place to find information. For example, the oscillator information in Digikey suggests that the u4 requires an external oscillator, while the u2 requires an internal oscillator. This is not the case; the u4 ships with the external oscillator as the default and the u2 ships with the internal oscillator as a default, but both can use internal and external clock sources.
What you need to change is not so much the bootloader (although if you want to build an Arduino compatible board, you'll need to upload an Arduino compatible bootloader) as the fuse bits.
The details of those (e.g. clock rate, brown out settings) are generally not relevant for Arduino compatibility, but the cleanest approach is to make a custom entry in boards.txt for your board, cloning e.g. a Leonardo entry but tweaking the fuse bits to your preferences. That allows you to set those fuse bits through the "Burn Bootloader" command in Arduino.
Best Answer
Compared to the
u2
, theu4
has:To answer this, I did a DigiKey search for each part number and compared the result tables. This is easier than comparing the datasheets, although datasheets are the most accurate place to find information. For example, the oscillator information in Digikey suggests that the
u4
requires an external oscillator, while theu2
requires an internal oscillator. This is not the case; theu4
ships with the external oscillator as the default and theu2
ships with the internal oscillator as a default, but both can use internal and external clock sources.