Design the PCB so that one line (TX to RX) has a pull up resister, the other (RX to TX) having a pull down resister. On startup, the chip checks to see which line is high - the TX or the RX. If the TX is high and the RX is low, make it master, otherwise it is the slave. The benefit here is that not only are every PCB and chip the same, but you also know which chip is master and which is slave and the startup is significantly less than any other method requiring some sort of startup and retry. You could get rid of one resister, but it may require a more aggressive algorithm, since the floating line could be seen as high or low (you'd set it high and see if it stayed high, then low and see if it stayed low) but this also leads to problems of driving the line (although briefly) and having conflicts as to both chips driving it, which would then require another resister between the two pins anyway. I'm sure there's some way around this, but I doubt if the extra design time and code is worth that one resister. This has the added benefit of being completely deterministic, and much easier to design and debug. -Adam John Nall wrote: > I am doing a little project which ideally involves two 18F452's side by > side, both configured exactly the same, talking back and forth with the > UART port. > > I would like to run the same program in both, but have one decide he goes > first, and the other to decide he goes second. > > About the only way that I can think of to do this is to set aside an > input > pin and pull it low on one chip and high on the other. This uses an > input > pin, which is not a big deal on the 452 since it has a slew of them. > But > more important (to me) it is not very elegant, because it means that in > fact they are not both configured the same. > > Can anyone suggest a way I can do this and have them configured the > same?? > > John > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body