2

Of the four pins on the usb I know the power and the ground pins are used to supply power to a USB device. But the other two pins D+ and D- what exactly do they do? whats their function? I think these pins transfer signals to and from the usb device to the computer and vice-versa.

An Electronics StackExchange answer says the two pins refer to differentially encoded transmission scheme that USB uses. What is differentially encoded transmission scheme?

And how does a computer software use these pins to communicate with with the usb device?

TonyM
  • 22,898
  • 4
  • 39
  • 64
Somanna
  • 335
  • 1
  • 4
  • 11

1 Answers1

6

The D+ and D- transfer data between host and device. They are also used for initial plug-in detection so host knows when to start enumeration with device.

Differential just means that both data pins have signal but transmitter drives these with opposite logic levels. Receiver compares D+ to D- to receive data, so data line voltages are not compared to ground as it may contain noise.

Software or the USB driver communicates with USB host peripheral chip to transfer data packets, software does not directly have control over D+ and D- pins.

Justme
  • 147,557
  • 4
  • 113
  • 291