> your limit per serial wire depends on how you approach it. That's certainly true. But I am mystified as to why so many people "hardcode" addresses into firmware -- that requires a custom version of the code for every chip on the serial network. I am also mystified as to why so many people "use a dip switch", which requires a bunch of pins to read the dip switch. Why don't these people use "scalable" networking protocols that scale up to an unlimited number of chips? Protocols that work fine with identical firmware in every chip, and only require a maximum of the "serial data in" pin plus 2 or so other pins on the master and each slave, even if there are dozens of slaves? Off the top of my head, here are 3 such protocols: (Pick whichever one protocol is the easiest for you to implement). (Please tell me about other "scalable" "simple" networking protocols, especially non-proprietary open standards). * daisy-chain serial SPI: (4 wires per slave; automatic baud rate synchronization) approach used by, among other things, JTAG scan. * decrement packet address: (2 wires per slave) each chip has a serial-in and a serial-out pin. The host serial-out pin is connected to the first slave serial-in pin. Each slave serial-out pin is connected to the serial-in pin of the next slave in the chain. (The last serial-out pin is typically connected to the serial-in pin of the master, for loopback test purposes). When a chip receives a packet of data on the serial-in line, it checks the destination address. If the destination is address "00", it accepts that data as a command, turns on lights, spins motors, activates the death ray, etc. etc. If the destination address is any other address, the chip forwards the packet to the next chip almost exactly. Every byte of the message is copied the same, except for the address byte(s), which are decremented. If the received address was "99", the chip sends "98"; if the received address was "01", the chip sends "00". (With a bit of clever programming, each chip does not have to wait until the entire packet is received, but instead can start transmitting at near-wire-speed as soon as the address byte is received). After forwarding the entire packet, the slave immediately forgets it (in particular, it does *not* accept that packet as a command). * daisy-chain select, common data: (3 wires per slave) The host serial-out pin is directly connected to every slave serial-in pin. In addition, each chip has a select-in and a select-out pin. The host select-out pin (which the host normally holds high) is connected to the first slave select-in pin. Each slave select-out pin (which the slave normally holds high) is connected to the select-in pin of the next slave in the chain. When the slave-select line of a slave is high, it "sleeps", ignoring the serial data line. When a slave sees its select-in pin pulled low, it wakes up, accepts first command on the common serial line (even if the command is "no-operation"), and then pulls its own select-out pin low and goes back to sleep, ignoring further commands until it is woken up again. When that slave sees its select-in pin pulled hi, it immediately drives its own select-out pin high and goes back to sleep. At some later time, when the slave sees its select-in pin pulled low, it (as always) wakes up and accepts exactly one command on the common serial line, then pulls its own select-output line low. (Even while sleeping and ignoring most commands on the common serial line, perhaps the slave might wake up on the special "On my mark ... NOW!" synchronized start command addressed to every slave). Perhaps one of these protocols could be used to automatically assign addresses whenever slaves are added, removed, or re-arranged, even if some global broadcast net (transmitting addressed packets) were used to transfer most data. The "daisy-chain SPI" protocol has a name; do these other protocols have a name? Is there a general name for this entire category of protocols, a better name than "scalable" "simple" networking protocols? -- David Cary http://carybros.com/ http://opencircuits.com/ http://wikiindex.org/Pica-wiki PIC/PICList FAQ: http://www.piclist.com http://www.piclist.com/member/DAV-MP-E62a http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus http://www.piclist.com/techref/postbot.asp?by=thread&id=%5BSX%5D+Bean%27s+SX28+8x8+PWM+Code+and+SX28+Addressable -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist