2

According to the docs, the Arduino Leonardo uses digital pins 0 and 1 for the USB D- and D+ lines. However, which is which? e.g. is D0=D+ or is D1=D+?

To save space in a very tight project, I want to wire USB directly to these pins instead of using the USB plug, however, I can't find any resource that explains which pin goes to which USB line.

3
  • Where does it say that pins 0 and 1 are D+ and D-?
    – Majenko
    Jan 10, 2016 at 19:05
  • "The ATmega32U4 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). The 32U4 also allows for serial (CDC) communication over USB and appears as a virtual com port to software on the computer."
    – Cerin
    Jan 10, 2016 at 19:52
  • 2
    I think you are completely misunderstanding what it is saying there. The UART TTL and the USB are two completely different things. The UART is on pins 0 and 1, and a USB CDC/ACM connection is also provided (dedicated pins on the chip).
    – Majenko
    Jan 10, 2016 at 19:54

2 Answers 2

5

The USB does not go to pins 0 and 1. The UART goes to pins 0 and 1 - that is a totally different interface.

The USB is connected to dedicated USB pins on the chip. If you look at the Leonardo schematic you can see it is pins 3 and 4 on the chip. Note that that is not pins D3 and D4 on the board, but the third and fourth pins anti-clockwise from the "pin 1" dot on the main chip.

3

As shown in the ATmega32U4 datasheet, D- and D+ connect to pins 3 and 4 respectively of the MCU. But you don't want to wire directly to the chip unless you know what you are doing since the chip does not include the USB termination resistors. Follow the schematics given in the datasheet when connecting to the USB pins of the MCU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.