On Mon, Jul 16, 2001 at 09:12:55PM -0400, Brandon Fosdick wrote: > 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. Debatable. There are no gurantees on correct collision detection with EIA-485 (it's no longer RS (Recommended Standard). It's a standard now. Also it'll slow down your overall throughput. Finally can you be absolutely sure how the receiver on the UART will react to incorrect data coming in? Collision detection is an iffy proposition at best. The fundamental flaw of a single channel EIA-485 system is that there is no inherent signalling attached. So signalling must be implemented. There are a few possibilities, a couple that you've already named: 1) None (Point to Point). The ring you described above. But it defeats the whole advantage of having EIA-485 in the first place. 2) None (collision). See comments above. 3) In band. Basically implement your token ring on the standard bus. The load of point to point transfers can be lessened by enabling 9 bit transfers and the address detection system built into the USART. This way folks will listen for their addresses only when the 9th bit is set, and can ignore data packets not addressed to them. Actually a fairly cool system that requires no additional hardware. The only costs are the extra bit transmitted cutting into throughput and the amount of time required to address a target (nearly 1ms at 9600 BPS) 4) Out of band signalling. The choice I hope to implement. I've described it in a previous post found here: http://www.infosite.com/~jkeyzer/piclist/2001/Feb/2727.html note that the username and password are the name of this list. Short summary: add a second signalling channel and use Time Slots to determine who transmits next. No collisions. For fairness each node has a Already Transmitted Slot that is after all of the primary slots. If the signalling channel is clear then the ATS is reached then all nodes in the ATS can move back to their primary slot. So even if every node wanted to transmit all the time, negotiation would be fair. Good point: it can be fast if the time slots are small. Another good point is like the inband above the UART can be turned off if you don't get the slot. It can even be coupled with the 9 bit addressing above once the transmitter is choosen. Bad points: requires extra hardware and extra software to implement. So those are some ideas. But trying to do collision in software probably isn't a real good idea. Ethernet works because the collision system is designed in the hardware. BAJ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads