The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Farabi on October 20, 2011, 04:06:15 AM

Title: USB Port
Post by: Farabi on October 20, 2011, 04:06:15 AM
http://www.beyondlogic.org/usbnutshell/usb2.shtml

In here he was mentioned about


As we have discussed, USB uses a differential transmission pair for data. This is encoded using NRZI and is bit stuffed to ensure adequate transitions in the data stream. On low and full speed devices, a differential '1' is transmitted by pulling D+ over 2.8V with a 15K ohm resistor pulled to ground and D- under 0.3V with a 1.5K ohm resistor pulled to 3.6V. A differential '0' on the other hand is a D- greater than 2.8V and a D+ less than 0.3V with the same appropriate pull down/up resistors.

The receiver defines a differential '1' as D+ 200mV greater than D- and a differential '0' as D+ 200mV less than D-. The polarity of the signal is inverted depending on the speed of the bus. Therefore the terms 'J' and 'K' states are used in signifying the logic levels. In low speed a 'J' state is a differential 0. In high speed a 'J' state is a differential 1.


D+ 2.8V for 1
D- +2.8V for 0

Does it mean I should just send bit 1 to pin D+ for 1 and send bit 1 to D- as 0?
Title: Re: USB Port
Post by: dedndave on October 20, 2011, 04:17:07 AM
i would think the differential driver/receiver is transparent to the programmer

if it isn't, a 1 would be:
D+ = 1
D- = 0

a 0 would be:
D+ = 0
D- = 1
Title: Re: USB Port
Post by: dedndave on October 20, 2011, 04:19:47 AM
QuoteUnless you are designing the silicon for a USB device/transceiver or USB host/hub, there is not all that much
you need to know about the electrical specifications in chapter 7. We briefly address the essential points here.
Title: Re: USB Port
Post by: tenkey on October 22, 2011, 07:36:11 AM
I've actually looked at USB signals and have been able to recognize the common bit patterns on a scope.
I wish I could tell you that a 1-bit was encoded as a differential "1" or "0", but it isn't.

And there is more to the signalling than just sending zeros and ones, which the "silicon" takes care of.