Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
    
Where does it say that pins 0 and 1 are D+ and D-? – Majenko Jan 10 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 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 at 19:54
up vote 5 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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