solarwind escreveu: > On Mon, May 18, 2009 at 2:11 PM, Olin Lathrop = wrote: > = >> Then you haven't given it much thought. Both ethernet and CAN do the >> collision detection in hardware. That's rather different than doing it >> youself with RS-485, especially since some quick timing is needed. >> = > > That's the key there. I don't want to burden the CPU with too much of > the protocol details. That's why I need the simplest type of protocol. > Token bus is awesome because it guarantees that there will never be a > collision. Also, the master polling system that you have mentioned > before is also awesome. If this doesn't work out, I'm going to do it > that way. > > The time slot system is also cool but I need a way to get the time > slot mechanism working and I have no idea how to do that. CSMA/CD is > cool too, but now we have to detect collisions. I think that's too > complicated for me. > = Collisions usually happen within a narrow window after the beginning of the packet. If you turn on the reception when you start transmitting and let an interrupt routine to check if what you are receiving is the same as you are transmitting, then you may be able to detect collisions. After the critical window ends, just turn off reception until you send the last byte, so you will not be burdened by checking every byte you send. If you detect a collision within the collision window, stop sending the packet and send a predetermined sequence to help other nodes to detect the collision also. Then back-off a random time and try transmitting the packet again. If a collision happens outside the collision window, then bad luck, but it should be rare. This is approx. how Ethernet handles collision, and I think there is no reason it won't work for other protocols/encodings/modulations. It appears somebody found that a node always sees the data it is transmitting, even when there is another node transmitting. If so, then it may be not possible to detect collisions at all. Regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist