> > Adam, > > Unless you have a really big house, you can circumvent the collision > detection by adding an arbitration phase. Without going into enormous > details, you can create an arbitration phase at the end of every message > that goes out on to the bus. The device who last sends a message may > initiate the arbitration phase by driving the bus low (opposite of the > stop bit) and then releasing it. All nodes listen to this falling edge and > start a timer when it occurs. Then all contending devices compete by > asserting the bus (driving it high - the same state as the stop bit) at > pre-designated time slots. The time slots, or arbitration slots may be > derived from the devices' addresses. The first one to assert the rising > edge wins the arbitration and will obtain control of the bus on the next > cycle. This is close to a scheme I was devising. A couple of questions. First what is the state of the line between the time that the last device releasing and the first device asserting? It's unclear from the description above. Secondly since UARTS are going to be a part of this I presume that the arbitration phase must be less that 1/2 of a normal bit time? That way none of the UART circuity should register the arbitration pulse as an actual start bit right? I was planning on having a separate arbitration line for this reason. Also with a separate arbitration line then the winner can start transmitting instantly instead of waiting for the arbitration cycle to end. Lastly it doesn't look fair which is the battle I had been fighting. In the scheme I devised I have a primary and secondary slot for each device. The secondary slots all fall after all the the primaries. So arbitration would happen like this: 1. Arbitration pulse starts the timers. 2. All primaries would check their slots, If the line is available then assert and start transmitting. After transmitting move to secondary slot. 3. If no primary answers then all current secondaries can move back to their primary slot after the first secondary answers. However if any primary answers then all secondaries stay put. 4. In all cases if the arbitration line is asserted in your slot wait until the next cycle. So this way if everyone wanted to transmit all the time then the bus would get assigned in round robin priority order. Once you've transmitted then everyone who is a primary will get a chance to transmit before you get to transmit again. Initial evaluation seems to give fairness without a chance of starvation. Also I had been in the mode of thinking that a single node would control the arbitration pulse. But clearly the distributed approach of having the last sender initiate the next arbitration cycle is clearly superior. I'm planning on getting a couple of students of mine who are working on a PIC based UDP/SLIP node to implement and test the scheme. I'll let you know how it turns out. > > The 'really big house' part comes into play when you start examinging the > size needed for the arbitration slots. The larger the separation between > devices, the bigger the arbitration slots need to be. Otherwise, > propogation delays throughout the network can cause one node's arbitration > edges to appear in another's slot. > > Like I said, I'm skipping the enormous details in what I've just outlined. > However I have implemented a variation of this theme with EIA-485 and > found it to be quite robust. (Hint: tying the uart RX line to the Input > Capture greatly eases the software overhead in capturing those edges). What an excellent idea! I'd just like to say how happy I am that you've rejoined the list. BAJ