Continue to Site

Welcome to

Welcome to our site! 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.

implementing a microcontrller network using RS485

Not open for further replies.


Newbie level 4
Feb 24, 2003
Reaction score
Trophy points
Monterrey, México
Activity points
485 network

I´m implementing a microcontrller network using RS485, so there goes my questions

1.-How can I implement a "multi-master" network(mora than one device can transmit over the same bus)

2.-Wich method is a good one for detecting if the bus line is clear or busy?

3.- Wich protocol is great, or if anyone has implemented how do you make it?

4.-Wich information should contain one transmision an how can i make it?

485 net


You need to use some CD "collison detect" methode for instance listen to the line and transmit only if the line is clean

a good protocol is somthing like HDLC but its to complicated bus for instance in the protocol header u should trnsfer your request size of data
{how meny byte you send }

and CS {check sum or CRC byte }



You can use the S.N.A.P protocol. It is good.

Check it in h##p://

good loock!


Any device can inititate data transfer if bus is available. All devices on bus are default to receive mode. As said by Bobcat1: use collision detection.
Check if bus is available before transmitting and if possible check (Rx) bit by bit if data put on output (tx) of micro is same. If not: means that another micro is busy with bus. Continue receiving the data and process. After that try to transmit again.

Always receive on interrupt. You will now that bus is busy. Switch all interrupt off for the micro which is in transmit mode.

All protocoll is great, cause they fit the purpose it is made for.
In my opinion you decide how many databytes you transfer in 1 packet, and also what the function is of each byte.
For example:
Byte01: Start of telegram (not needed if 9-bit is used)
Byte02: To address
Byte03: From address
Byte04: Number of bytes following( not needed if fixed length packets are used)
Byte05....Bytexx: Number databytes as needed for your design: functioncodes, commands, bit settings etc
Bytexx+1: Checksum

You find out first what information is needed to be transferred from micro to micro, then build your protocoll.

I use a fixed packet of 5 bytes:
to address
functioncode: set output, reset output, input status, change micro address on bus etc
databyte1: which output to set, new address etc
databyte2: any more usefull data

My bus is just a 20mA current source, shorted with micro output to generate data pulses. Can also be fed into PC Rs232 port for monitoring/trouble shooting/Multiple node configuration changes etc.

Have fun playing with this. Is very interesting, took me also several weeks before it worked without any problems and data loss.

I think this RS485 Active Hub (5 port) is exactly what you need.
It contains the following points:
Circuit Diagram
Parts List
PCB Layout
PCB Art: Bottom
PCB Art: Top
PCB Art: Drilling
Case Art
Product Firmware


RS485 interface chip LTC1482 from Linear Technology provides an active low carrier detect output pin.

Hi riverhills,

Can you mention the main features of CANBUS

I don't think it would be the right thing to post a general info which is available from anywhere on the net.
Anyhow, CAN network is a very robust hi-speed network which is implemented in a hardware. There's lots of MCUs with on-board CAN. Still RS485 is simpler and cheaper. Stick to it.
As suggested, use LT part with carrier detect.



Here are some basic considerations. This can help you


Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to