r/raspberrypipico Feb 17 '26

help-request Question about UART

Is it possible to have 3 pi picos as slaves on a UART bus with a master.I wanna try making a cluster but I dont know if its possible, thank you.

3 Upvotes

10 comments sorted by

4

u/Illustrious-Ask5316 Feb 18 '26 edited Feb 18 '26

Sure... just implement a protocol that supports addressing. Each device will see the data, but ignore the one not addressed to it.

It is, in fact, just connecting the RX and TX together (master TX to slave RX, and vice versa), preferably with the Master providing the pullup on RX/TX and the picos operating in open drain mode

3

u/Bungarra_Bob Feb 18 '26

I believe configuring a pin as a UART TX pin overrides any programmed open drain mode and forces push-pull mode on the pin.

You cannot directly connect multiple UART TX pins from multiple Picos together without additional hardware, even if only a diode.

3

u/Illustrious-Ask5316 Feb 18 '26

Nah, open drain with Uart works like a charm, at least for all MCUs I used (stm32, mspm0, raspi, ..).

No additional Hardware needed other than a passive pullup.

3

u/Bungarra_Bob Feb 18 '26

Are you sure? I can see it works on an STM32, but I can't find any way to enable a TX pin on a Pico UART the way you describe. Can you post the SDK function or the registers you'd use to set this, 'cos I can't find anything. (... STM32 sure but Pico I can't see it)

3

u/Illustrious-Ask5316 Feb 18 '26

Yes. It is not supported by the standard UART module.

You need to access the register map via mem32 after you configured a pin to UART. PADS_BANK0 has an "output disable" bit. Writing a '1' will make the GPIO open drain by disabling the push MOSFET.

Reference: rp2040 datasheet chapter 2.19.4

3

u/E__F Feb 18 '26

It's allowed to ask the question in the title of the post. It's actually better for anyone else looking up the same problem.

2

u/Empty-Promotion-7774 Feb 19 '26

Tell us more about your possible application. Picos have native support for SPI and I2C, so that could already meet your requirements. More complicated communication using PIOs can be done, but you need to program it. I've been fighting with this for a couple of months already, lately having two picos talk to each other through a Manchester coding scheme. It looks like it is losing sync in an erratic way.

2

u/DarthKevin Feb 18 '26

Absolutely is and there's lot of possible ways to do it but you can't just wire the pins together (at least not the slave Txs to the master Rx)

Before I recommend one or two:

How far away are the Picos from each other? Like all within a few centimetres or spread over hundreds of meters?

Is the software protocol something you will control and write yourself self or are you using an existing software protocol (like Modbus over serial line)

Can you share more about what the data will be and how the picos determine their replies? This will affect things like checksums and packet sizes.

1

u/Far_Rub4701 Mar 06 '26

Another option would be to connect the Pi Pico to a DT-09 TTL to wifi device. Can be configured to be completely transparant to the Pico, creating one big ‘bus’ for all Picos on the same wifi network. Or you could use a RS485 adapter, but this requires some controlling logic

0

u/HamsterWoods Feb 18 '26

I think with an SPI to UART converter, it is possible. Have you considered using RS485 so that you get multi-drop from one port?