On Wednesday 25 May 2005 12:32 pm, Olin Lathrop scribbled: > ... What happens when a node has something to say, but it can't > just squawk it out? Do you have a master that queries each node in turn? > How many nodes does it query? What happens when a queried node goes down? > Do you wait for some timeout? How do you detect new nodes being added? > Will you leave enough room in your home grown protocol to accomodate future > expansion? So far, my thoughts for most of this are as follows... - Master will query each node in sequence asking "do you want to send anything"? - Master will wait for a specified time for a response. No response in specified time means an error occurred. I've been toying with the idea of re-trying once or twice, but haven't determined that yet. Any error is indicated at the master station (specifics TBD). - When the master gets a response, it will be addressed on the bus to the master, but the data will indicate if it is intended for another station, and the master will pass it along. - I'm planning to implement an acknowledgement to the slave that message was received. - Master will send out message on the bus, which the appropriate slave will respond to. - Master will expect an acknowledgement within a certain time, else error. - Master will continue with next node. - I might need a broadcast message, but will not expect an acknowledgement for that. If I do, I'll have the master send it to all stations individually/sequentially. Latency is not an issue here. At this point, there will be about 10 stations, but I was planning to allow for 16. However, for simplicity, and since traffic will be relatively low, I'm thinking I'll just send a full byte as the station id/address, and another with the command, and perhaps a third with some checksum, etc. That last part is yet TBD. The messaging will be very specific to each station, so new nodes will require a firmware change at the master, since it will need to be setup based on the type of node. I don't plan to put anything automatic in for this. Cheers, -Neil. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist