The origional idea was similar to that. I normally start all messages with [255] then a command. EG, 254 would mean set address. Any device connected would take the 3rd byte and set it as its address.

The way im doing it now is a little more complicated. Each device will know how far away from the master it is. Its complicated a little further because there are 2 sockets on each device for in and out but it doesnt matter which way you connect them.

There are 5 wires (and a screen):-
1) Power +
2) Power -
3) Data A
4) Data B
5) Not thought of a name for this yet

The master will keep #5 high constantly. The first device connected to it will check both of the sockets to see if #5 is high on it. If it is then it knows that socket is the input. The default is for both sockets to be inputs so #5 will be low by default unless the master is present. This means that only the first device will see a high on #5 so only that device will set itself an address.

Since the last post ive changed the way the addressing works so there is no need for a PIC chip in the master. All devices will default to [0]. The first one to get a high on #5 will add 1 to the address and save it (it is now device 1). It will then switch to send mode and send the address out to all the other devices then switch back to receive mode. All the other devices will use the new address as the default.

The first device will now make #5 high on whichever socket is still low which causes the next device to set itself an address etc.

I know it sounds complicated but it means that all the devices will automatically address themselves. If i connect all the devices in a straight line then it doesnt matter which order i put them in along the line, they will still function in the correct order.

Once all the devices have a unique number that they can be accessed by then i can set a second address through serial. The data would only require the second byte changing and they can be accessed by their specific address or by their position in the line. It saves having to connect one up at a time to address them or having a button on the back that you press to accept the address.

The position address will be reset everytime the devices turn on but the address that is set by sending a command will be saved in the EEPROM and only change when it gets a change command.

Im using the 555 method in the master but not in the individual devices. Each device only needs to send a small amount of data when they first turn on and possibly when a certain command is sent. They should never need to send data during normal operation