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.
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?
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).
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.
When the I2C_IRQHandler indicates that the transfer is finished.
You surely know that you're really not giving us much to go on.
Thanks for your reply, the I2CEngine() simply set the data Buffer to transfer and set the Start Flag of I2C after all communication is done by the I2C_IRQHandler (code: 0x08,18....), but how can I know when the transmission is ended? Thanks.
When I use the function I2CEngine()
Sorry, but without you giving us some detail, it's difficult for us to guess where that function comes from. Is it something you wrote? a library? is there any documentation relating to the function? Have you read that documentation? Is there any sample code?
View all questions in Keil forum