Is it possible to send data to multiple slaves over single UART BUS?

Thread Starter

Gajyamadake

Joined Oct 9, 2019
313
Hi forum
I have read that data can be transferred to a multiple slaves in I2C bus. I have one doubt Is it possible to send data to multiple slaves over single UART BUS ?If an answer is yes, how can it be done?
 

kubeek

Joined Sep 20, 2005
5,724
I think you are mixing two things, UART as a periphery on a microcontroller, and your typical serial connection between two devices.
For example RS485 interface is controlled from your uC´s UART, but it is can work like a multi-slave network. Maybe you could say more about what you actually need to achieve?
 

Papabravo

Joined Feb 24, 2006
13,728
Hi forum
I have read that data can be transferred to a multiple slaves in I2C bus. I have one doubt Is it possible to send data to multiple slaves over single UART BUS ?If an answer is yes, how can it be done?
I don't understand why you think this might be a problem?
 

Thread Starter

Gajyamadake

Joined Oct 9, 2019
313
I think you are mixing two things, UART as a periphery on a microcontroller, and your typical serial connection between two devices.
For example RS485 interface is controlled from your uC´s UART, but it is can work like a multi-slave network. Maybe you could say more about what you actually need to achieve?
Consider, There is a MCU and it has single UART and There are four devices that work on the UART protocol

I don't understand why you think this might be a problem?
In I2C communication, every device has their unique address, through which we know which device to send data to. In Spi Communication there is an option to select every device. In UART How do I know which device to send data to?
 

Papabravo

Joined Feb 24, 2006
13,728
You include the address in the message. Everybody receives all bytes of all messages, but only one device has to respond, if that is the behavior that you want. BTW, you can make this work on RS-232 half-duplex or full duplex
 

kubeek

Joined Sep 20, 2005
5,724
In I2C communication, every device has their unique address, through which we know which device to send data to. In Spi Communication there is an option to select every device. In UART How do I know which device to send data to?
The data inside the transmission has to show which device should receive it. Or to put it better, all slaves will receive it but only the correct one will react.
 

Thread Starter

Gajyamadake

Joined Oct 9, 2019
313
Can you send UART data to multiple slaves?
Yes, I do this all the time, using RS-232, RS-485, and 0-5V TTL signalling.
Its like something
1586627114174.png

I am looking for all the answers are related to hardware okay fine so hardware is not a issue

My thought is that when we will write a program, how will know in program to which device need to send ?
 

MrChips

Joined Oct 2, 2009
21,126
Is the master the only sender? Do slaves need to respond?

Are you allowed to attached a slave ID in the message sent from the master?
 
Top