Close

MappyDot Addressing

A project log for MappyDot

Micro Smart LiDAR Sensor

bleckyBlecky 07/22/2017 at 13:360 Comments

One of the core features behind the MappyDot is the ability for devices in a chain to automatically assign addresses to each of the devices.

When the MappyDot switches on, all devices go into a discovery state and wait until they receive an address command. All except for the first in the chain which is the master. The master will first assign it's own address as 0x08 and then initialise the address protocol:


This address protocol is very simple and is based on the 1wire interface. The master sends the next address to be assigned, the slave then responds with what it thinks its address is then the master will ACK with 0x01 if this is correct (or NACK with 0xFE). If there is a NACK, the master and slave will retry. If there are too many retries, then they will blink an error code.

Once the slave has got its address, it then begins this process with the next device in the chain while acting as the master.

So if you now scan, you should see all the devices in the chain (after a few ms depending on the number of devices).


But what if you want to change the address range of the devices, instead of starting at 0x08? Well, that's simple. All you need to do is connect the ADDR_IN pin of the first device in the chain to your microcontroller, and initiate the addressing process with the start address you desire.

Because it is based on 1 wire, you just perform the 1wire detect presence procedure. If there is presence, then send the address, wait for the response, check that the address matches and send 0x01 for ACK or 0xfe for NACK.

Discussions