Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to communicate between 2 or 3 8051 microcontrollers

Status
Not open for further replies.

prevravanth

New Member
I want communicate between three 89S51,and ouput of each 89S51 should go to Serial Port & display in Hyperterminal.

Data are coming from each external interrupt
of 89S51 and ouput is in serial port at present in each stage

I want integrete all data's of each stage 89S51 microcontroller
and display in hyperterminal through single Serial port Rs232.


Please kindly help me.:confused:
Thanks
 
hi,

Do you want to RS232, 'send and receive', all 3 MCU's to the PC
or just receive the 3 MCU's at the PC?

EricG
 
You can use I2C for 8051's to communicate with each other and UART with tocken ring protocol to communicate with PC.
 
Last edited:
ericgibbs said:
hi,

Do you want to RS232, 'send and receive', all 3 MCU's to the PC
or just receive the 3 MCU's at the PC?

EricG

Yes I want All MCU's to pc becasue each MCU is handling signal and giving output to PC in serial port through RS232.:confused:
 
hi prevravanth,

If you have 3 external MCU's RS232 output lines connected together 'somehow' , how are you going to prevent more than one MCU using the serial line at any one time?.

Unless the MCU's have some sort of interrupt priority control you are going to have arbitration problems at the PC end. That is, while one MCU is transmitting, the other two MCU's may start transmitting.

The easiest solution I can suggest, is that you install a dual uart pcb in the PC.
Use the existing Com1 for say MCU #1 and the Com3 and Com4 for the other two MCU's.

The program in the PC then can determine which MCU is sending.

If the PC program is written to respond to OnComm events for Com 1,3 and 4 it will not miss any incoming RS232 data
from any of the MCU's.

An additional advantage is that the PC can transmit to each individual MCU.

Eric
 
Last edited:
One method that comes to mind is to use an open-drain or open-collector RS-232 bus of sorts (drawing #1 shows a MOSFET open-drain interface). Then design a master/slave command protocol that includes a 'slave' address so that each 'slave' knows when to put data onto the bus in response to a command request from the host.

This async' serial bus method is used at TTL signal levels by Icom in their CI-V protocol (drawing #2).
 

Attachments

  • RS-232 Circuit for 16F627A.jpg
    RS-232 Circuit for 16F627A.jpg
    46.3 KB · Views: 1,731
  • CI-V Bus Drawing.JPG
    CI-V Bus Drawing.JPG
    38.7 KB · Views: 1,443
Last edited:
I would use the hardware Mike K8LH gave you.

Also, you need to control collisions (what happens if two of the units signal your PC at the same time)? You get garbage. Are they only sending one byte or a string of bytes?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top