On Thu, Mar 10, 2011 at 1:28 AM, Kerry Wentworth wrote: > How does the slave know when the master has read the data? =A0Is it > possible that the slave is sending data, and then sending the next data > before the master gets around to reading the first data? > > I usually use 2 control lines, Master to Slave and Slave to Master. > Lets call them MS and SM. =A0When the slave wants to send data, it sets S= M > high. =A0When the Master see SM high, it reads the data and sets MS high. > When the slave sees MS high, it sets SM low. =A0When the master sees SM > low, it lowers MS. =A0When the slave sees MS low, it knows it can send th= e > next set of data. =A0This works 100% of the time, with no chance of misse= d > data. What I've actually got is 4 control lines, though some aren't really connected directly to the data transfer. The two most relevant are AR (address ready) and DR (data ready). The master puts an address on the bus, then sets AR high. The slave sees AR high, drops DR, puts the requested data on the bus, and sets DR high. The master then reads the data, drops AR, puts a new address on the bus, and then sets AR high again. I had my logic analyzer on it last night, and while I'm not near it now, I'm nearly certain that the last thing I was seeing prior to the stall was the slave drop, then reassert DR, but no response from the master. When I halted the master the INT2 flag wasn't set. I'm going to re-check that as soon as I can. Josh --=20 A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. =A0 =A0 =A0 =A0 -Douglas Adams --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .