For the back off time I suggest you use each device's ID number. Then place the faster re-trying devices in the most important parts of your network. Simple, effective and intutitive for the installer, lower numbers mean better comms, higher numbers mean lower priority. As to the echo verification method - its is used in several places. One that comes to mind is Texas Instruments graphical calculators - they use a simple 3 line, 2 way, echo verification comms setup; see their site for details. You could expand this with the IEEE-488 Talker/Listener scheme where an extra line is pulled low by *ANY* device to initialize comms with the Master (who then sets up a private conversation by telling all other Slaves to UNListen until the bus is released). Bye. -----Original Message----- From: Brandon Fosdick [mailto:bfoz@GLUE.UMD.EDU] Sent: Tuesday, 17 July 2001 11:13 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]:Thoughts on RS485 collision detection For my project that uses an RS485 network I was planning to use a token ring system so I don't have to deal with collision detection. But I got to thinking about it and now I'm wondering if it might be worth doing. The solutions I've seen posted so far (and on piclist.com) all seem to be of the bitbang variety. Since I'm using 16F877's for this project it seems like a waste to bitbang stuff when I have a nice USART to use. Has anybody done this yet? I'm thinking that if I leave the receiver enabled (im using a max487) the USART should receive a byte for every byte that it sends. If the two bytes are different a collision has occured. First off, that sounds too simple, like something that somebody has already thought of and rejected. Second, whats a good way of handling back-off and retransmission? If all the devices are set for the same back off time, or time increment, they'll just collide again. I guess I could implement a random number generator, but I'd rather not. Is there a good way to handle this? How should retransmission be handled? Obviously the sending device needs to retransmit the lost data, but how does the receiving device know that a collision has occured? If it doesn't know there's been a collision it might think the corrupted data is valid. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads