Is it possible to have two serial ports open on the Pico with one USB connection?
-
- Posts: 6
- Joined: Mon Dec 13, 2021 3:01 am
Is it possible to have two serial ports open on the Pico with one USB connection?
When I plug in the RP2040 Pico via USB, I want to see two serial ports that I can communicate with. One will be used to communicate with the Pico, and the other will be used as a serial passthrough for a second device connected to the Pico. I'd appreciate any suggestions on how to go about implementing this using MicroPython. Thanks!
-
- Posts: 16
- Joined: Wed Jun 08, 2022 1:05 pm
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
Hi
Sorry for the late answer. Maybe you've already found the answer. If not, here's a pointer to the solution:
This is possible, but not without making your own version of MicroPython. Fortunately others had the same question before you (not me!).
I've found this interesting link for you:
https://forums.raspberrypi.com/viewtopi ... 2#p1979332
Good luck!
Sorry for the late answer. Maybe you've already found the answer. If not, here's a pointer to the solution:
This is possible, but not without making your own version of MicroPython. Fortunately others had the same question before you (not me!).
I've found this interesting link for you:
https://forums.raspberrypi.com/viewtopi ... 2#p1979332
Good luck!
-
- Posts: 6
- Joined: Mon Dec 13, 2021 3:01 am
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
Thanks, Filip. I might as well as drop to C for implementing this. I found that TinyUSB has a dual CDC port example:
https://github.com/hathach/tinyusb/tree ... dual_ports
https://github.com/hathach/tinyusb/tree ... dual_ports
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
What about the examples using the PIO to implement a UART? See this link.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 16
- Joined: Wed Jun 08, 2022 1:05 pm
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
That's an option indeed if you don't need the rest of the features you get using MicroPython
electronut wrote: ↑Wed Jun 15, 2022 2:45 amThanks, Filip. I might as well as drop to C for implementing this. I found that TinyUSB has a dual CDC port example:
https://github.com/hathach/tinyusb/tree ... dual_ports
-
- Posts: 16
- Joined: Wed Jun 08, 2022 1:05 pm
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
Hi Peter, the question was to have two virtual (CDC) serial ports on one USB connection, don't see how you can do that using PIO
pythoncoder wrote: ↑Wed Jun 15, 2022 9:45 amWhat about the examples using the PIO to implement a UART? See this link.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Is it possible to have two serial ports open on the Pico with one USB connection?
Ah, sorry. I didn't even know that such a thing was possible.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.