| Author |
Message |
Sputnik
Joined: 19 Oct 2004 Posts: 150 Helped: 3 Location: South Africa
|
11 Nov 2004 18:50 USB NRZI Interface Protocol |
|
|
|
I am reading through this tutorial about USB interfacing and it speaks about the NRZI (NonReturn to Zero Inverted) protocol that states the following:
-Toggle each bit time for multiple data 0s.
-Do not toggle each bit time for multiple data 1s.
-Toggle each data 1 to 0 pair.
-Do not toggle each data 0 to 1 pair.
It also says this is why the USB specification implements the therm "bit stuffing", that after 6 consecutive 1 data bits, a 0 is inserted or "stuffed" so as to maintain synchronization and this is really confusing me. How will the downstream device (that I'm designing) know that a bit has been "stuffed" into the data stream.
Anyone who knows of what this means and how it works, please explain to me.
Thanks
Sputnik
|
|
| Back to top |
|
 |
maolh
Joined: 16 Jun 2003 Posts: 39
|
23 Dec 2004 20:46 Re: USB NRZI Interface Protocol |
|
|
|
| what is the NRZI interface protocol for? I heard about NRZ coding before, is something related to this.
|
|
| Back to top |
|
 |
checkmate
Joined: 25 Feb 2004 Posts: 489 Helped: 35 Location: Toilet Seat
|
23 Dec 2004 21:38 Re: USB NRZI Interface Protocol |
|
|
|
| Sputnik wrote: |
I am reading through this tutorial about USB interfacing and it speaks about the NRZI (NonReturn to Zero Inverted) protocol that states the following:
-Toggle each bit time for multiple data 0s.
-Do not toggle each bit time for multiple data 1s.
-Toggle each data 1 to 0 pair.
-Do not toggle each data 0 to 1 pair.
It also says this is why the USB specification implements the therm "bit stuffing", that after 6 consecutive 1 data bits, a 0 is inserted or "stuffed" so as to maintain synchronization and this is really confusing me. How will the downstream device (that I'm designing) know that a bit has been "stuffed" into the data stream.
Anyone who knows of what this means and how it works, please explain to me.
Thanks
Sputnik  |
USB segments each bit using a predefined clock. For usb1.1, it's 12Mbps. It's 480Mbps for usb2.0. The signaling is as given. "Bit stuffing" is required for synchronization purposes. Although both host and device tries to use the predefined bitrate, but they are using different oscillators after all, and if you have a long string of 1 bits, you may lose or gain one bit place.
However, we use usb controllers most of the time to handle such low-level signaling. Unless you are a usb IC designer, you don't really need to know all these stuff. If you want to design a usb device, you need to know the higher level protocol, mainly Ch9 of the specs, and maybe part of Ch8.
|
|
| Back to top |
|
 |
Sputnik
Joined: 19 Oct 2004 Posts: 150 Helped: 3 Location: South Africa
|
24 Dec 2004 19:02 USB NRZI Interface Protocol |
|
|
|
The fact is that the USB chips aren't sold, or at least I haven't ever seen them, here in my country. I can't order them because my dad doesn't like order over internet, plus it will be expensive. I would still like to understand this so that should I buy a microcontroller that is powerful enough, I can program it for USB interface.
Sputnik
|
|
| Back to top |
|
 |
checkmate
Joined: 25 Feb 2004 Posts: 489 Helped: 35 Location: Toilet Seat
|
24 Dec 2004 20:07 Re: USB NRZI Interface Protocol |
|
|
|
It is very difficult to implement one using a microcontroller simply because of the extremely high bitrate required. But someone has amazingly implemented one on an AVR. Search for IgorPlug.
But IMO, it's quite insane to implement one, and even if you succeed, you probably won't have any more clock cycles left to service any other tasks simultaneously.
|
|
| Back to top |
|
 |
benri22
Joined: 08 Apr 2004 Posts: 24
|
24 Dec 2004 21:48 Re: USB NRZI Interface Protocol |
|
|
|
Please look at this link:
http://www.beyondlogic.org/dddtools/dddtools.htm
benri22
|
|
| Back to top |
|
 |