tell it to pull the line back the other way when its ready? -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Rick Regan Sent: Wednesday, March 31, 2004 10:01 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: Deciding who is master 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: > I am assuming the UART is used only for communicating > between the 2 PICs. In other words, pic1-TX is > connected to pic2-RX; pic1-RX is connected to pic2-TX. > 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. > At start-up, all lines are inputs. Read the state of > the RX & TX lines. > Pic 1 will have TX hi & RX low > Pic 2 will have TX lo & RX hi So, for example, the PIC that sees TX hi & RX low would be the master, and the PIC that sees TX lo & RX hi would be the slave. At the time we didn't discuss how the master and slave synchronize (the master can't start transmitting until the slave reads the pulled up/down state). What is the best way to do this? The original poster was trying to reduce the number of I/O pins used and wanted the hardware and firmware to be as symmetric as possible. The "cheapest" way to synchronize that I could see is to designate one pin on each PIC (output on slave, input on master) that means "slave ready to receive." Any other ideas? -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu