# What are the advantages of having USB part of the microcontroller (as the Leonardo does)?

The new(ish) Arduino Leonardo has an ATmega32u4 microcontroller which is different from the Uno. This controller has built in USB functionality and it can interface with a PC as a HID which is different than any of the other Arduino boards.

What are the other advantages to using the ATmega32u4 chip instead of the ATmega328 which requited a USB-UART chip to program and had limited USB capabilities?

## 1 Answer

Speed! You can send out up to 1000 frames of data per second of data to the 32u4 using it's virtual serial port. The older boards with their FTDI chip and UART bridge are limited to around 38 kbaud before signal reliability problems start to set in.

You can also represent more devices than just 'com port' -- for instance emulating a keyboard and a mouse. If you get fancy and use a new firmware like LUFA you can appear to be many more types of devices.

• +1 for emulating keyboard or mouse. You can do some interesting projects with that. – rslite Apr 10 '13 at 0:09
• What is a "frame" in the context of a virtual serial port? Please define your terms a bit better. If a "frame" can only contain one byte, that would only be 1000 baud. Also, FTDI FT232RL USB-serial bridges (used on the older arduinos) can easily do 3 mega baud, so any speed limitation is not the FTDI device. The newer ATmega8/16U2 based boards are a different matter, though. – Connor Wolf Apr 10 '13 at 9:35
• @Connor, I've tested with 64 byte frames on a Teensy 2.0 which is a 32u4 based Arduino spinoff. When I've tested FTDI-bridged chips, I've found data quality starts to degrade around 32 kbaud of sustained traffic or so so the overall system (FTDI -> PCB bridge -> AVR UART -> software library) doesn't seem to be capable of handling the higher speeds. – Jay Apr 10 '13 at 13:45