Hi All, I'm using an 18F14K50 running at 3.3V, programming with C18 in MPLAB. Circuit is programmed and powered via PicKit 3. I'm trying to communicate with a I2C EEPROM (24xx1025). Currently I can send a Start Condition and load SSPBUF with the first byte to send, then I wait for the R_W bit to go low before writing to SSPBUF again. No interrupts are enabled, I2C is done via polling the SSPSTAT bits. I'm looking at SDA and SCL on a 'scope. Problem: the I2C doesn't pump out the second byte. I've checked the device errata, but there is nothing related to this. I've looked at the generated assembly code and it looks fine. It's very similar to the I2C write sequence shown here: http://www.piclist.com/techref/microchip/w-r_i2c.gif In fact, this is what I used to write my C code. One solution I've figured out is to wait for R_W bit to go low again (as shown in the code). Can anyone point out anything I'm doing wrong, or forgetting to do? Below is a portion of the C code (excuse any whitespace issues, I've got tabs set to 4 spaces, but gmail may butcher it): uint8_t I2Ctest(uint8_t control, uint8_t addressH, uint8_t addressL, uint8_t data) { =A0 =A0IdleI2C(); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0//ensure modul= e is idle =A0 =A0I2C_START(); =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0//initiate START= condition =A0 =A0while( SSPCON2bits.SEN ) {;} =A0 =A0// wait until start condition is= over =A0 =A0SSPBUF =3D control; =A0 =A0 =A0 =A0 =A0 =A0 =A0//write control byte =A0 =A0while(SSPSTATbits.R_W) {;} =A0 =A0 =A0 //wait until write completes =A0 =A0while(SSPSTATbits.R_W) {;} =A0 =A0 =A0 //wait until write completes = - IF THIS IS HERE, THE SECOND BYTE WILL BE WRITTEN SSPBUF =3D addressH; //write address high while(SSPSTATbits.R_W) {;} //wait until write completes ... End code Any help/advice will be appreciated, Scott Larson -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist