??? 04/15/08 12:08 Read: times |
#153364 - collisions avoidance ? Responding to: ???'s previous message |
Andy Neil said:
Ap Charles said:
N means any number of nodes , whose physical address isnt known, yet they knows the masters physical address . I need some effective way to find how many are present within the reach of the master .
http://www.8052.com/forumchat/read.phtml?id=153345 So, first, you will need to ensure that every slave node is assigned a globally-unique, unalterable "physical address". This in itself can be a non-trivial exercise... You could then use, say, the least-significant nibble of the "physical address" to group slaves for polling: the master would first poll for all slaves with a "physical address" ending 0; then it would poll for addresses ending 1; then it would poll for addresses ending 2; then it would poll for addresses ending 3; etc, etc... This would mean that you'd only have to deal with collisions between slaves of the same "group". When a new slave receives a poll of the correct group, it responds; If it doesn't get the right reply, it waits for a random[1] delay before responding to another poll; Once it's had the right reply, it ignores further polls. You could even allow your customers to specify which "groups" they want when buying units, so that they could optimise their network... The problem is , the master cannot poll the slaves as address keeping by the master for unknown number of slaves is difficult . Earlier you said it right that slaves should broadcast randomly , that would help master know how many are there . The problem here is if we put a random number for the slaves to broadcast , there could be collisions ? . Also they may waste power unnecessarily if the master isnt present. Ap |