No description
Find a file
2023-10-23 15:59:19 +09:00
.github add arduino example and arduino ci 2022-06-17 15:17:49 +07:00
.vscode Fix vscode setting 2022-12-30 18:41:10 +09:00
examples make device_info.ino Arduino sketch applicable for Pico W 2023-04-17 07:42:59 +03:00
src Update default config 2023-10-04 21:54:11 +09:00
.gitignore First prototype 2021-12-18 23:32:54 +09:00
CMakeLists.txt Created cmake file for this as a proper library. 2022-05-21 15:47:31 -06:00
library.properties Bump to 0.5.3 2023-10-23 15:59:19 +09:00
LICENSE Initial commit 2021-12-18 10:49:37 +09:00
README.md fixed typo in README.md 2023-07-22 17:31:22 +02:00

Pico-PIO-USB

USB host/device implementation using PIO of raspberry pi pico (RP2040).

You can add additional USB port to RP2040.

Demo

https://user-images.githubusercontent.com/43873124/146642806-bdf34af6-4342-4a95-bfca-229cdc4bdca2.mp4

Project status

Planned Features Status
FS Host
LS Host
Hub support
Multi port
FS Device

Examples

  • capture_hid_report.c is a USB host sample program which print HID reports received from device. Open serial port and connect devices to pico. Default D+/D- is gp0/gp1. Call pio_usb_add_port() to use additional ports.
  • usb_device.c is a HID USB FS device sample which moves mouse cursor every 0.5s. External 1.5kohm pull-up register is necessary to D+ pin (Default is gp0).
  • host_hid_to_device_cdc.c is similar to capture_hid_report.c which print mouse/keyboard report from host port to device port's cdc. TinyUSB is used to manage both device (native usb) and host (pio usb) stack.
cd examples
mkdir build
cd build
cmake ..
make
# Copy UF2 file in capture_hid_report/ or usbdevice/ to RPiPico

Another sample program for split keyboard with QMK

https://github.com/sekigon-gonnoc/qmk_firmware/tree/rp2040/keyboards/pico_pico_usb

Resource Usage

  • Two PIO
    • One PIO is for USB transmitter using 22 instruction and one state machine
    • Another PIO is for USB receiver using 31 instruction and two state machine
  • Two GPIO for D+/D- (Series 22ohm resitors are better)
  • 15KB ROM and RAM
  • (For Host) One 1ms repeating timer
  • (For Device) One PIO IRQ for receiver