]> sigrok.org Git - libsigrokdecode.git/commit
usb_signalling: Track USB symbol width to compensate frequency errors
authorStefan Brüns <redacted>
Tue, 29 Sep 2015 22:24:24 +0000 (00:24 +0200)
committerUwe Hermann <redacted>
Tue, 6 Oct 2015 15:41:21 +0000 (17:41 +0200)
commita241cfb6e1fbf1f7c85109a54e914672b633f5f3
tree564d9e52394b0315df99fbb50c14121c7bce0992
parent0e3cb15e814f20b201709688ab4eaa6eee54dc40
usb_signalling: Track USB symbol width to compensate frequency errors

USB low/full speed allows for frequency tolerance of 1.5%/0.25%. At
maximum packet size (sync + PID + data + CRC16) of 12 bytes/1027 bytes
this amounts to 1.4 bits/20 bits, so the decoder has to lock to the
actual symbol frequency to avoid any symbol misdetections.

The signal is sampled twice, once at the symbol center and once at
the expected edge position. Comparing the symbol at both positions gives
an indication if the current bit width is too low or too high. Adjust
accordingly.
decoders/usb_signalling/pd.py