Thanks Olin, ----- Original Message ----- From: "Olin Lathrop" To: Sent: Wednesday, September 05, 2001 8:20 AM Subject: Re: [PIC]: I2C and Master + multiple slaves. > > Your plan sounds workable, but there are a few points to keep in mind: > > 1 - I would only use IIC if all the devices you mentioned are physically > close, on the same board or in the same closed box. This is the case here, all components are in the same enclosure, small area, short lines etc ... > 2 - I wouldn't run the IIC bus faster than 400Kbits/Sec due to the > Microchip MSSP bug and the capacitor on SDA as a workaround. See archives. Never heard of this bug. Will certainly read about it. Thx. > 3 - The Microchip MSSP module doesn't allow for a slave to slow down a > read (slave to master) transfer. The slave had better respond with a byte > when the master asks for one. On a write transfer the slave can avoid being > overrun with the clock stretch feature, but this isn't available for reads > for some reason. Ok. > - Is collision detection and handling very hard to implement > > No, because there can never be collisions. All transfers are initiated by > the master. > > The trick will be for the master to know when a slave has data for the > master to read. You also don't want the bus to stall for very long, so the > master also probably needs to know that a slave has room in its buffer for a > whole input packet before one is sent. One way to do this is for the master > to poll each of the slaves in turn with a short message the only requests a > status byte. The master would only send or receive a packet to a slave when > it knows the slave is ready to do so. I might implement a fixed and continuous polling cycle from the Master then.I should be able to fit all this in 400kbps. With a large enough output buffer in the Slave PICs in case the USART input overuns the I2C polling rate of the Master (doubtfull though). This should eliminate any critical timing, polling or handshaking conditions. regards, _________________________ Tobie Horswill torswil@exmachina.qc.ca -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics