Jonathan Baker writes: > Im working on a network using PICS. > > All nodes on the network are identical, all joining onto a single bus - > ie each pic doesnt receive and the re-transmit the data. > > (each pic is also programmed identicaly - including ID bits) > > Can anyone think of a way to get each PIC to allocate itself a unique > number - node ID. ... but if there are 50 PIC modules then I want the > numbers 1 to 50 or 0 to 49 for the numbers no more no less. > > I think I have a way of doing this but Im not saying anything right now. The problem as you have written it does not make sense to me. Unless, that is, you are talking about a network of nodes that do only processing and no I/O. In this case you can have a master allocate a number to the first slave that answers a broadcast. But, surely you have some additional hardware that makes each node different from the others. And the node must know what is special about itself for it to work. Imagine a network with two nodes, one connected to a hot water tap and the other to a cold water tap. Each node has to know whether it is hot or cold for it to do its job. Given this, if you think about your hardware you should be able to come up with a node ID based on the hardware it is attached to. Mal -- http://www.nfra.nl/~mgoris/