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
 

SphinX

Advanced Member level 3
Joined
Jan 25, 2002
Messages
822
Helped
58
Reputation
116
Reaction score
29
Trophy points
1,308
Location
EGYPT
Activity points
7,051
Salam,

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

Bye
 

davyzhu

Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
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
 

hed

Newbie level 3
Joined
Aug 20, 2004
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
49
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
 

glenjoy

Banned
Joined
Jan 1, 2004
Messages
963
Helped
72
Reputation
146
Reaction score
20
Trophy points
1,298
Location
Philippines
Activity points
0
50 meters? Now that is a distance, I think RS232 standards will not anymore work properly in that distance, try RS485, it is better.
 

bulesman

Newbie level 2
Joined
Aug 26, 2004
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
20
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.
 

vkchau

Member level 4
Joined
Jun 7, 2003
Messages
74
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,288
Activity points
664
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.
 

amazonite

Member level 3
Joined
Sep 1, 2003
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
536
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.
 

conkhicon

Advanced Member level 4
Joined
Aug 31, 2004
Messages
107
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Activity points
1,015
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).
 

chinara

Full Member level 1
Joined
Sep 15, 2004
Messages
96
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
842
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.
 

hock

Advanced Member level 2
Joined
May 28, 2001
Messages
525
Helped
47
Reputation
94
Reaction score
21
Trophy points
1,298
Location
India
Activity points
3,567
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
 

chinara

Full Member level 1
Joined
Sep 15, 2004
Messages
96
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
842
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.
 

XNOX_Rambo

Advanced Member level 1
Joined
Jul 13, 2002
Messages
435
Helped
90
Reputation
180
Reaction score
2
Trophy points
1,298
Location
Far out, man!
Activity points
3,571
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
 

banh

Advanced Member level 1
Joined
Dec 16, 2004
Messages
458
Helped
17
Reputation
34
Reaction score
5
Trophy points
1,298
Activity points
3,939
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

Top