sekigon-gonnoc / Pico-PIO-USB

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

does this mean USB will use up two PIOs fully? #50

Open laoshaw opened 1 year ago

laoshaw commented 1 year ago

the existing Pico USB provides either a host mode, or device mode with 32 endpoints(or 16 two-way), which typically is enough but it is a mux-mode(can't use both host and device at the same time), so this project can make Pico act as both a host and device(one uses existing USB hw, another one uses this project), but it means I have no PIO at all left for other purposes? correct? It seems even though not all SMs are used by USB here, but all instructions memory are used up. Please let me know if I misunderstood. Thanks!

ebadger commented 1 year ago

I'm seeing the same - I've got a project where I'm using one PIO fully for VGA output - too many instructions between the 3 SM for PIO USB to fit in a single core it seems.

tannewt commented 11 months ago

The RX PIO is 32 instructions (15 for nrzi decoder and 17 for edge detect). So it doesn't have room for anything else. The TX PIO uses 22 instructions. So, you can share the TX PIO if your program is less than 10 instructions total.

henrygab commented 2 weeks ago

The release notes for 0.6.0:

Single PIO version

Rejoice! I haven't investigated how, but ... wow!