2

This is about how USB ports/devices work

Lets say i have a USB port on my computer

enter image description here

If I have an arduino board or something similar, am I able to connect output to Data+ and sort of make my own USB keyboard. What I aim to achieve is send without having to receive

enter image description here

1) Would I need to connect it to both D+ and D- so it forms a circuit in order for the USB port to read the data? (or would the data simply be read and then disappears so I don't have to worry about two wires?)

If Yes: 2) If I manage to forcefully push electricity through the wire onto the Data pins, would I only need one wire?

Else: 3) is this physically impossible and the whole universe would explode if I tried?

2
  • There are no separate data input and output pins. So no, you can't.
    – gre_gor
    Mar 22, 2017 at 3:17
  • The "B" is USB stands for Bus. It would be worth a read to understand how a bus is different to, for example, a serial port (where this sort of thing could work).
    – Mark Smith
    Mar 22, 2017 at 9:58

2 Answers 2

3

D+ and D- are not send and receive. The two signals are complementary to each other and bidirectional.

They form a low voltage differential pair. When one is high the other is low and vice versa.

Both have to be connected for USB signals to get through.

The data is sent down both wires at once, but only in one direction at a time (half duplex).

There is far more data going through USB than the data you are sending. The data you see is the end result of a complex protocol negotiation between your device and the host.

2
  • Thanks! it's a great answer. Am I able to only transmit data without receiving? I am able to connect to both D+ and D-, but I can only output data from my board, it doesn't receive data. For example, I'll just hardcode transmit the right data at the times I know when I should transmit, so i don't need to listen to the computer? Mar 23, 2017 at 4:31
  • It is up to you what data is sent over the connection and in what direction. If you don't send data between the computer and the device then there is nothing for the device to read.
    – Majenko
    Mar 23, 2017 at 10:25
3

USB is a host-managed protocol. A USB device must be able to receive in order to operate, since the host notifies the device when it should send data back to the host.

The D+ and D- lines are not independent; the signaling state of the line is determined by examining both lines regardless of whether the host or the device is transmitting.

USB Made Simple

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.