I2C module/state macine issues
Hello, I have quite a problem with my I2C module.
I'm reading a value in a device register on the bus. I thus have the following protocol:
Address+Write | Register | Adress+Read | Data Master Master Master Slave
This protocl works fine and I successfully read the data in the register. Now the problem is when I place this in a while loop, because the second time I try to send data, the Data Register(I2CMDR) is impossible to update. I thus think tis is a problem related to the state machine of the I2C, as when in the receive state maybe writing this register is not allowed.
But this is the values I write in the I2CMCS register and the state in which the module should be, and I find no errors:
Master Idle State -> Write, RUN+START -> Master Transmit State -> Read, RUN+START+STOP -> Master Idle State
So at the end of the loop, the I2C should be in an Idle state, allowing writing on the I2CMDR register right? What I am missing then?
login or register to reply
|