At 09:12 PM 16/07/01 -0400, you 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. > >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? In practice, the local receiver will see an echo of what you sent even if there was a collision. This happens because of the voltage drop in the network cabling and due to the receiver only needing a small differential voltage to make it work. It won't see the fault which is farther away. >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? Do the nodes each have an address? If so, base the retry on the address. >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. Frame the data in packets with unique start & end characters. Is there a master in the system that can poll the slave nodes? Regards... -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads