1
\$\begingroup\$

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)?

\$\endgroup\$
5
  • \$\begingroup\$ You could roll your own RS232-ish protocol with an SPI-like Chip Select function or an I2C-like address byte. Or build a TCP/IP stack :) \$\endgroup\$
    – user17592
    May 18, 2013 at 10:09
  • \$\begingroup\$ I only want to use RS232, and process all other problems in 8051s. Moreover, there is no collision is this network, because supervisor starts each conversation. \$\endgroup\$
    – Ramyad
    May 18, 2013 at 10:13
  • \$\begingroup\$ Depends on how long the bus is and if you want to protect against configuration faults (crossed wires, input/output misconfigured, ...) I personally like to use series resistors while experimenting, to limit current. \$\endgroup\$
    – jippie
    May 18, 2013 at 10:38
  • 1
    \$\begingroup\$ RS232 is really not intended for multi-drop situations. Whatever you do, it's probably going to be a bit hackish. \$\endgroup\$ May 18, 2013 at 10:42
  • \$\begingroup\$ Yes, I have taken a feedback from the students that some packets are lost \$\endgroup\$
    – Ramyad
    May 18, 2013 at 10:45

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ Yes, I have taken a feedback from the students that some packets are lost. So I think maybe it is a power problem. But with your first solution I think this problem will be solved \$\endgroup\$
    – Ramyad
    May 18, 2013 at 10:46
  • \$\begingroup\$ @Ramyad, yes it could well do that, sometimes if you connect outputs together apart from possible damage if one output is high and others are low you end up getting voltages like 2V instead of 5 which may give erratic results. \$\endgroup\$
    – PeterJ
    May 18, 2013 at 10:51
  • \$\begingroup\$ They are using AT89C51 which does not support high z on its I/O. And the problem I have mentioned in above comment is from main 8051 transfer data. Could they put a buffer in the TX line? \$\endgroup\$
    – Ramyad
    May 18, 2013 at 10:51
  • \$\begingroup\$ @Ramyad, it could be worth a try although I guess first step would be to try with a single unit and make sure if it works reliably (if you haven't already). It would also be worth getting a couple to TTL to RS232 (or USB) adapters so you can see what is really being sent, and if available maybe use a scope to see what the signal quality looks like. \$\endgroup\$
    – PeterJ
    May 18, 2013 at 10:55
  • \$\begingroup\$ Thanks, tomorrow I will see their modules and test them. I will come back and update the question if needed. \$\endgroup\$
    – Ramyad
    May 18, 2013 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.