Connect 8051 serial port to multiple 8051s

8051serial

I want to design a project in which one supervisor 8051 communicates with four other 8051s. I'd like the students to implement this project with some server-client view. That means that the TX port of the main 8051 will be connected to all other 8051s.

I want to make sure that there is no problem with fan out or power. I want all 8051s get the same data but decide if the data for them or not. Is it correct to connect one TX pin to 4 other RX pins without any buffering (and vice versa)?

Best Answer

I wouldn't imagine fan-out or power problems so connecting the TX line of the master to four RX lines should be fine. The problem is in the reverse direction, you'll be connecting four TX lines (that are all outputs) to the master's RX line. A couple of solutions come to mind:

  • Enable the UART receiver on all slave devices but leave the transmit line in a high-impedance state. When a slave has received a message addressed to it set the transmit line as an output, send the message and then go back to a high-impedance state. Some microcontrollers support doing this and some don't because enabling the UART sets TX as an output an RX as an input automatically. If you use this method you'll need a pull-up on the master receive line so it's not floating when no slaves are transmitting.

  • Use a 4-1 multiplexer on the receive line of the master so that before sending a command to a slave it can select one of the slave TX lines so only one is logically connected at a time.

Option 1 is the way I'd go if using a microcontroller where the UART receiver can be left enabled while the transmitter is disabled. Other options to consider would be SPI and I2C which are both designed for multi-drop communications. Serial (which you can convert to RS232) is probably a nice option for a student project though because of the ease of debugging communications with a PC.

Related Topic