Dual UART. Anyone with experience of using the multiple init() call method? #16744
Replies: 2 comments 1 reply
-
The RP2040 has two independent UARTs. You can use them both at the same time. In addition you can use the PIO to create more UART devices. See https://rp2040pio-docs.readthedocs.io/en/latest/example-scripts.html#uart, which refers to the RP2040 data sheet, sections 3.6.3 and 3.6.4. |
Beta Was this translation helpful? Give feedback.
-
I am not sure what you mean here. You can use |
Beta Was this translation helpful? Give feedback.
-
I need two UARTS. CircuitPython has no options here but MicroPython has this statement: "It is possible to call init() multiple times on the same object in order to reconfigure UART on the fly. That allows using single UART peripheral to serve different devices attached to different GPIO pins." It does seem to offer a solution but there are other considerations such as the TX & RX buffers. What happens to data already in the buffers - is it cleared or is it left in-situ? How long does the changeover take? My guess is the buffers are cleared which seems sensible,. I am driving a pair of DFPlayers at 9600. The TX data is not a problem but the DFPlayer status (busy, stopped, paused) is required so the best strategy would be to wait for the last command response before switching. Has anybody any experience of using multiple init() calls? It may be the method has too many issues in which case I might use two Picos with I2C between them.
Beta Was this translation helpful? Give feedback.
All reactions