Hi, I'm trying to comunicate with an external EEPROM like PCF8582 with the uC LPC1115, but I've to understand a thing: When I use the function I2CEngine(), how can I know when the transmission has finished and if all goes well? Thanks.
When the I2C_IRQHandler indicates that the transfer is finished.
You surely know that you're really not giving us much to go on.
Ok, but the problem is that I set the START bit and the I2C routine goes to code 0x08 that's correct, load the Buffer with the Slave Address, if the Slave is connected the I2C routine goes to state 0x18 that's correct, but if the Slave isn't connected on I2C Bus, the I2C routine does not go in state 0x20 (NOT ACK received).. Why?
Thanks too much.
Sorry it goes on state 0x20 and it's correct.
LPC_I2C->CONSET = I2CONSET_STO; /* Set Stop flag */ LPC_I2C->CONCLR = I2CONCLR_SIC; /* Clear SI flag */ while( LPC_I2C->CONSET & I2CONSET_STO );
This is my I2CStop() function, it's possible that if I'm in while loop to wait the Stop condition all system does not respond? (No interrupt).
but if the Slave isn't connected on I2C Bus, the I2C routine does not go in state 0x20 (NOT ACK received).. Why?
Without a slave device connected, where do you suppose that ACK would come from?