liam . wrote: > I tried the following code provided by Hector and still have the same > problem. The program forever loops in the I2C wait. Considering that > this code works for Hector (correct me if Im wrong) as well as the > other code direct from application notes and websites and my own ideas > all haveing the same problems I am shifting my focus to hardware. > > What size pull ups do other people use ?? At the moment I am testing > using a CRO and have no slave I2C components on the bus, i was under > the impression I should still see activity such as I2C start. I'm using 10K successfully right now. I can't see where I2C hardware problems could cause hangups. If a device does not respond, you get a NACK for the address byte. A possible hangup could be a forced CLK line low, since that would stop the current transfer (clock stretching). SDA going low means the START bit is properly sent (SDA high-to-low transition while CLK high means START). I haven't tried the ICD, but I wouldn't trust it much when working with hardware comms. Can you check using some simple debugging (bringing some outputs high on certain code points or similar)? Does it hang on the check after setting SEN high, or does it hang after placing the slave address in SSPBUF? As an aside note, I just saw a bug in my code: I clear SSPCON2 while in bank 0 (which clears TMR2 instead). It is probably not the cause of the problem, but worth noting. -- Hector Martin (hector@marcansoft.com) Public Key: http://www.marcansoft.com/hector.asc -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist