Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

USB NRZI Interface Protocol

Status
Not open for further replies.

Sputnik

Full Member level 3
Joined
Oct 19, 2004
Messages
150
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Location
South Africa
Activity points
1,667
usb nrzi

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 :idea:
 

maolh

Member level 2
Joined
Jun 16, 2003
Messages
42
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
364
avr nrzi

what is the NRZI interface protocol for? I heard about NRZ coding before, is something related to this.
 

checkmate

Advanced Member level 3
Joined
Feb 25, 2004
Messages
833
Helped
178
Reputation
356
Reaction score
125
Trophy points
1,323
Location
Toilet Seat
Activity points
7,815
usb protocol nrzi

Sputnik said:
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 :idea:
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.
 

Sputnik

Full Member level 3
Joined
Oct 19, 2004
Messages
150
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Location
South Africa
Activity points
1,667
nrzi usb

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 :idea:
 

checkmate

Advanced Member level 3
Joined
Feb 25, 2004
Messages
833
Helped
178
Reputation
356
Reaction score
125
Trophy points
1,323
Location
Toilet Seat
Activity points
7,815
how nrzi works

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.
 

benri22

Junior Member level 1
Joined
Apr 8, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
273
explain nrzi in detail

Please look at this link:

**broken link removed**

benri22
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top