Hi! I want to Know how to connect and program multiple AT89c51 on a common serial bus so that no one can produce conflict with another client AT89C51, how can i ensure the bus conflict in case of multi master system.What would be the maximum number of clients i can handle on this common bus system.can i find some theory/stuff/material regarding this issure. Regards! Ahmad Kamal.
how can i ensure the bus conflict in case of multi master system.What would be the maximum number of clients i can handle on this common bus system.can i find some theory/stuff/material regarding this issure. Master-slave is (typically?) collision avoidance, whereas multi-master (typically?) is collision detect. I can not see any way you can have multiple masters with collision acoidance, to avoid cillision, you would need a "masters master" For examples of collision resolution, have a look at the IIC bus or the J1708 standard. I, personally, have avoided multi-master as the plague, except when forced (such as communicating with j1708 devices) you do what you want, I would have a REALLY good look and see if I could do the needed with a master-slave rig. Erik The best (and most) IIC appnotes i: http://www.semiconductors.philips.com/buses/i2c/support/index.html A little true story about collision detection: In the J1708 standard, the rule is that when a collision is detected, the transmitting devices insert a random delay before attempting the transmit again. Two devices, both using the Keil rand() function collided and, had I not stopped them, they would still be fighting today. The Keil rand() insert the same sequence every time it is used.
A bit more info: What would be the maximum number of clients i can handle on this common bus system Using "1/8 unit load" RS485 transcievers, you can have 256 units on the bus. With standard transcievers (75176) you can have 32. An addition to my "Master-slave is (typically?)..." post above: conflict detection buses are (most often?) single ended (noise sensitive). Conflict avoidance buses can be differential (noise resistant). Erik
Master-slave is (typically?) collision avoidance, whereas multi-master (typically?) is collision detect. You're omitting the middle way, as used by CAN bus: arbitration. This allows several simultaneously started messages, forming a collision, but makes sure that by some point in the communication cycle, the situation is resolved, leaving a sole surviving transaction going on unharmed by the collision. One way of looking at this is as a collision avoidance system using a many-level hierarchy of master privileges, defined dynamically on a per-message basis, rather than statically on a per-node basis. Another way of looking at it is as a collision detection system that avoids wasting the bus time already used up by the time the collicision is detected. It does this by allowing one of the colliding messages to continue, as opposed to killing off all of them, which would eat up bandwidth proportional to the collision rate. [...] The Keil rand() insert the same sequence every time it is used. Of course it does --- as does every correctly implemented C library's rand() in the world. It's a requirement for rand() to behave that way, and the reason why srand() exists.