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.

implementing a microcontrller network using RS485

Status
Not open for further replies.

ruli

Newbie level 4
Newbie level 4
Joined
Feb 24, 2003
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Monterrey, México
Activity points
41
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

Hi

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 }


bobi
 

Hi!

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

Check it in h##p://www.hth.com/plm-24/

good loock!
 

Hi,

Multimaster:
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
Checksum

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

485hub1:
https://www.airborn.com.au/photo1/ab192.html
 

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
Thanks.
itp
 

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.

trace
 

Hi

Here are some basic considerations. This can help you

h**p://w*w.national.com/an/AN/AN-1057.pdf
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top