sekigon-gonnoc / Pico-PIO-USB

USB host/device implementation using PIO of raspberry pi pico (RP2040).
MIT License
1.36k stars 145 forks source link

Resynchronize clock phase on rising edge of dataline #62

Closed sekigon-gonnoc closed 1 year ago

sekigon-gonnoc commented 1 year ago

In conventional implementations, the clock is synchronized only on the first edge of the data line. This PR implements a mechanism to resynchronize on the rising edge of the data line. This may improve #18

The USB specification allows for some clock errors; in the case of USB LS, even if the RP2040 clock is sufficiently accurate, a 1.5% clock error of device can cause out of sync by around 30 bits (cumulative error exceeds 50%).

This PR implements following features:

image