Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

implementing a microcontrller network using RS485

Status
Not open for further replies.

ruli

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?
 

bobcat1

Advanced Member level 4
Joined
Jul 10, 2002
Messages
1,288
Helped
99
Reputation
198
Reaction score
34
Trophy points
1,328
Activity points
8,547
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
 

ljmnunes

Junior Member level 3
Joined
Jun 28, 2001
Messages
29
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,283
Location
Brazil
Activity points
158
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!
 

msmax

Full Member level 1
Joined
May 6, 2001
Messages
99
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Pays Bas
Activity points
919
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.
 

ME

Advanced Member level 4
Joined
Mar 14, 2002
Messages
1,309
Helped
55
Reputation
112
Reaction score
40
Trophy points
1,328
Activity points
14,861
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:
http://www.airborn.com.au/photo1/ab192.html
 

cdcll

Full Member level 3
Joined
Feb 15, 2002
Messages
163
Helped
8
Reputation
16
Reaction score
1
Trophy points
1,298
Activity points
1,199
RS485 interface chip LTC1482 from Linear Technology provides an active low carrier detect output pin.
 

ITP

Advanced Member level 4
Joined
Jul 11, 2001
Messages
116
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
1,130
Hi riverhills,

Can you mention the main features of CANBUS
Thanks.
itp
 

trace_ru

Junior Member level 3
Joined
Mar 9, 2002
Messages
28
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
The bright side of the Earth
Activity points
242
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
 

papyaki

Advanced Member level 2
Joined
Apr 13, 2002
Messages
539
Helped
38
Reputation
76
Reaction score
18
Trophy points
1,298
Location
France
Activity points
5,346
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top