> This is a thread from 06/08/2003 that I am reviving. It > dealt with two identical PICs (with UARTs) and how to > select - at startup - one as master and one as slave. > Here is one of the solutions we liked: > > If that is the case, put a pull-up resistor on one of > > the 2 lines and put a pull-down resistor on the other > > line. That is totally determinate. If you want to be able to nominate one or other with certainty it seems a sound idea and costs 2 resistors. If you want them to decide amongst themselves you could have a mutual arbitration session where the first one to start up asserts a line to claim mastery. IF RX high I am slave ELSE Assert TX high Wait a short period IF RX low I am master ELSE dead heat - start again END END This would work well except when there was a dead heat which would be rare and could involve a pseudo random backoff and retry. Random generator would need to be dependent on a seed that was not the same for both processors. After deciding there could be some handshake to test that both had decided correctly. The two resistors are sounding attractive :-) Russell McMahon . -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu