A protocol I am writing has a problem. I was wondering if any of the many smart people around here has a solution.. or could point me to a protocol that has this all sorted.
Packets of data are send src dst address over a two three wire bus like I2C, interconnecting several MCU's, Like I2C this protocol has a General Address.
Here is my problem.
Below is the section of the protocol that deals with addresses and how to do dynamic allocation of addresses. but if two devices both send the Device Address Set Command at the same time, say when they are turned on, then forever will they by bouncing commands back and forth untill they both overflow thr addresses.
Is thr any method I can use to prevent this from going on?
General Address A General Address is only valid as a Destination Address. All nodes must listen for packets sent to this address and process them.
Dynamic Address Self-Alocation on the General Address
The node wishing to assign it self an address should pick the first address number (a=1) and send a Device Address Set Command to the General Address.
This will inform all other Nodes of the New Nodes Address. If the Src Address Matches that of any reciever then the Reciever, who has the matching address, should send a Device Address Respond Command to the General Address.
So any Node that recieves a Device Address Response Command with a Source matching it's own must select a new address (a+1) and try this address repeating the above steps.
If the the address overflows trying to self assign then there must be 255 addressed devices in the Node Collection, in this case this node should send no more messages on the Bus.
DaveC