Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Connecting several 8052 microcontrollers on a bus

Status
Not open for further replies.

hed

Newbie level 3
Joined
Aug 20, 2004
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
49
Hi guys,
i'm building a system where several 8052 will communicate with each other by sending messages.

The distance between each microcontroller will vary between 1 meter and 50 meters. There will be a master microcontroller which will send messages to all other (slave) microcontrollers. The slave microcontrollers will also be able to reply to the master. However, there will be collisions when 2 slaves respond to the master at the same time.

I'm thinking of some kind of RS-232 bus using the built-in UART of the 8052. Can i simply connect all Tx pins of slaves to Rx pin master and Tx pin of master to all Rx pins of slaves? Will this design work?

Can anybody suggest how this can be done. Or else, if there are some other ways to design this.

Many Thanks
Hed
 

Salam,

Search for "Final Word 8051 " book at EDABoard.
And read chapter 10 (i think) about "Networking using 8051"

Bye
 
Hello,

Well, do you know RS485, RS232 is 1 Tx to 1 Rx, and RS485 maybe 32 to 32. Check RS485 chips by TI or NSC or Moto.

Cheers,

Davy Zhu
 

How does the CAN standard work?

How do i interconnect the 8052s? Should i use some kind of amplifier for the signals to travel 50 meters? MAX232?

Thanks
Hed
 

50 meters? Now that is a distance, I think RS232 standards will not anymore work properly in that distance, try RS485, it is better.
 

8O R232 just fine for less than 10 meter,so you better use RS485 IC.And you system ,slaver mcu only send meseage after receive the master`s reguestion.I think it will answer you purpose.
 

Actually, in pratice RS232 can operate for 50m, but only with low baud rate, low noisy. I did it with 4800bps, it is correct.
In your system, I think you can design an async server or use RS485. Async server is a device has a RS232 master port and many RS232 client ports. The master device polls client devices and wait for responses from clients.
 

I suggest that if your request is less than 12 meter and only two MPU in the bus. You maybe can use the RS232 bus. But if your MPU more than 2 pic or the distance between MPU and MPU more than 12 meter. The RS-232 protocol maybe not suitable your application. You can consider the RS-485 bus.
 

Hi
Should use RS-485
If use RS232 then topology:
TX1->RX2 TX2-> RX3 TX3->RX4 ... TXn->RX1 (same RING BUS)
Not master and slaver.
If a part receive a new value, it check data:
- if it's data was receiver.-> process data
- If none, it transmit data over it's TX. (the same at repeater).
 

Yes, what you want to do is possible and practical. The key lies to the slaves. The slave which has the permission of the master could own the bus with a certain period. I call this as the shared serial bus. The distance is another problem. Optical isolation may be a good way to lengthen your RS232 upto 1Km.
 

just use CAN or wiznet Hardware TCP-IP modules.
CAN is a serisl bus operating in differential mode and can operate at speeds up to 1MBPS and at 100kbps@1km length.

hock
 

I think use the optical isolation solution may be cheaper than CAN solution. Although the optical couple solution is rather old, it is easy to make at low speed.
 

The 8051 (and its derivatives) is an excellent MCU for this type of communication
because it supports - in hardware - a multi-processor mode that uses a ninth bit
in the serial stream to indicate address bytes. In this way it is very simple to
avoid collisions in the communication.

A multidrop RS-485 topology is the perfect marriage to this communication mode
and I have used it several times with great success.
Once I used the MCU nodes as repeaters on a several kilometres long 4-wire
cable, 2 power and 2 data, and there were almost no communication errors and
those were detected by a simple CRC.

You only need to implement a very simple protocol - forget about CAN, TCP/IP
and any complex ones, keep it simple. The 8051+RS-485 combo is so robust and
simple to implement - I just love it! :spoko:

/Rambo
 

within 15 meters, you can use RS232 @ 115 kbps using shielded cable. This distance can be increased if baud rate is kept low.

higher data transfer and long distance (1.2 km max.) -> RS485.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top