>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." Hmm, this may not work for this situation if both PICs are on the same power supply, unless you slug the MCLR line of one with a larger capacitor than the other. However a scheme I have seen used on a multidrop mini computer system went as follows: - machine is powered up. It then proceeds to listen on the serial line for a period of time to determine if there is already a master device. If there is activity then it assumes the slave role, else assumes master role after time out of the listen period. Note that this involved two machines which ran identical software, and the time it took from power on of one machine to power on of the second machine gave enough delay for the first machine to assume master state. In this case they kept each other in sync by the master first talking to the slave with a message "I am going to call device x for data" to which the slave would respond with an affirmative message, and then both would listen to the answer from device x, and record it. You may be able to implement something similar in your code, but personally I would seriously look at having a conditional assembly to set one copy as master, and the other as slave, on otherwise identical source code. It may even be a flag in eeprom that is programmed later, or a single location in rom that gets an updated program later. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu