Thomas Magin wrote: > At 16:00 29.04.1998 +1200, you wrote: > > Hi, > > >the data takes about 1 second to obtain. Is there a way > >I can get the master that sent the request to wait for > >the PIC without the PIC becoming the master and > >transmitting the data back. > > one possibility (which I used) is to provide another line for handshaking. > The master is requesting data (by sending a write-command) and if the line > is activated the master will issue a read-command. > > > > >Does the I2C protocol define a way of communicating with > >very slow devices on the bus? > > Another way is what they call "clockstretching". If a slave gets a > read-command it is allowed to pull the SCL high until it is able to provide > the data. In your case this would result in a 1sec wait for the master. Here > it depends on its hard- and software how to handle this waitstate. The time > this will be take is not defined by the I2C-protocol ! Doesn't the slave hold the clock line low? I could bewrong - I'll have to RTFM again. The easiest way could be for the slave to NACK (not ack) when the master issues its address, and the master to keep polling until ACK'ed. This is incidentally the fastest way of writing to an I2C E2PROM Both above methods are standard I2C. -- Friendly Regards Tjaart van der Walt mailto:tjaart@wasp.co.za |--------------------------------------------------| | WASP International | |R&D Engineer : GSM peripheral services development| |--------------------------------------------------| |SMS mailto: 0832123443@wasp.co.za (160 chars max)| | http://www.wasp.co.za/~tjaart/index.html | |Voice: +27-(0)11-622-8686 Fax: +27-(0)11-622-8973| | WGS-84 : 26¡10.52'S 28¡06.19'E | |--------------------------------------------------|