I have a question on the interaction between Pi Pico, CircuitPython, and USB. I need a way to send a data stream from the Pico to another computer where it will be received on a USB port (it's the only possible input port). Do I assume correctly that I cannot use the Pico's USB port for that, because it is already used by CircuitPython for its file system and/or REPL? Does that mean that in order to develop with CircuitPython, I would have to send the data on UART instead and use a TTL-to-USB converter?
3 Answers
You can do it via USB HID, re. the Pico works as a Keyboard, sending data to a connected computer.
- 26
- 1
You can also communicate with host via USB serial device - a better choice for sensor data perhaps; this works in in C from pico so should be possible with circuit python
- 11
- 1
It works with the two USB ports that CircuitPython supports. And it works on all devices listed on this page, where the Pico is one of them: usb_cdc – USB CDC Serial streams
You get the list of supported devices by expanding the triangle "Available on these boards".
Microsoft Windows:
The prerequisite is a flawless installation of drivers on the PC. I had an issue with Windows 7 which installs only one serial port - the console port. Windows 10 seems to be the minimum OS version.
Then add two lines in boot.py:
import usb_cdc
usb_cdc.enable(console=True, data=True)
The 2nd serial port becomes visible in Device Manager as soon as connect your board with your new boot.py
- 101