LPC-P1343 I2C unexpected 0xf8 state after sending start bit

Hi all,

I’ve a Olimex LPC-P1343 board and I’m trying to solve a problem regarding I2C bus from several days without any result :frowning:

After I sent a start bit, the status goes (correctly) to 0x08 (start bit trasmitted); in this status my software routine must load slave address into I2CDAT register and then clear SI bit in I2CCON register to start trasmission of slave address over the bus. At this point I expect to be in two possible status: 0x18 that means address trasmitted and ack received or 0x20 that means address trasmitted but not ack received but, after clearing the SI bit, the status change to 0XF8 that means “no relevant state information available”.

I’ve check and recheck the procedure of initializing the I2C bus, I’ve also tried to send slave address without any device attached to the bus but I obtain the same result. SDA and SCL lines are pulled up with 2.2 KOhm resistors.

I don’t know really where to turn please help me :cry:

Thanks in advance

Mirko

Unfortunately at today I haven’t found a solution. All kind of help are wellcome. My code is downlodable at this link: git://github.com/mirkomes/Rilevazione_Temperatura.git

Thanks again

Mirko

Finally I’ve solved the problem. The problem was I was writing in a clear register not directly with a = operator but with a |= operator. This deletes all bits in I2C configuration included enable bit. Now all works perfectly.