Does USB have error correction in it?

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone,

I've been playing around with Paul's Teensy code here:

http://www.pjrc.com/teensy/rawhi...

My question is: Does USB inherently have error correction built into it? I've read that it uses a crc to validate data, and that is has an acknowledgement...

Thanks,

Alan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, AFAIK there are no means for error correction in USB. However, some services provide error detection and retransmit packets if needed.

No RSTDISBL, no fun!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it does have error detection.

http://www.beyondlogic.org/usbnu...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

says there's a 16 bit CRC for data frames.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Error correction or just error detection?

There is a principal difference between "error corection" as in ECC ("Error Correcting Code") and as in "error detection triggers a resend".

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

USB has detection of errors via a CRC on each packet; if corruption is detected, the USB controller will drop the packet and the host will have to (automatically) re-send it - unless it is an Isochronous type endpoint. For Isochronous endpoints, corrupt packets are just dropped and not re-sent.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Thanks everyone.

Dean - I haven't given LUFA a try yet, but I plan to.

I did get Paul's rawhid example down to 1.5k and it allows me to send a 64 byte packet every millisecond for 64,000 bytes per second. I got his code working in C++ Builder 6 which I know is old, but I've developed in it for years so it is familiar.

I really like the send a packet, receive a packet style communication.

Thanks,

Alan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
USB has detection of errors via a CRC on each packet; if corruption is detected, the USB controller will drop the packet and the host will have to (automatically) re-send it - unless it is an Isochronous type endpoint. For Isochronous endpoints, corrupt packets are just dropped and not re-sent.

- Dean :twisted:

What applications/device types use Isochronous end points? Keyboards?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What applications/device types use Isochronous end points? Keyboards?

Isochronous is for unreliable, time-critical data. In terms of defined USB classes it's pretty much just the USB Video (Webcams, etc.) and Audio classes. Keyboards use the HID USB class, which requires Interrupt type endpoints.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It does:

 

"If the data is corrupted while transmitted or received, the CRC check fails. When this happens, the receiver does not generate an ACK, which makes the sender resend the packet."

 

https://en.wikipedia.org/wiki/USB_(Communications)#Data_packets

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess the world may still be interested but just to point out that you are replying to a thread that was last alive in 2013, eight years ago ;-)

 

Moderator.