AnsweredAssumed Answered

STM8 Slave : I2C Write and Read

Question asked by pradeep on Nov 14, 2012
Hi all,

I have an issue while the I2C-host writes and reads to/from the STM8-I2C-Slave. Write operation is immediately followed by a Read.

1) I2C Master writing to STM8-I2C-Slave      : s A2w a 0A a 47 a 40 a p
2) I2C Master reading from STM8-I2C-Slave : s A3r a 0A a 47 a 01 a 00 n p
3) I2C Master writing to STM8-I2C-Slave      : s A2 w a 0A a 47 n p

The Master sends (1) and (2) immediately one after the other and this is working correctly.
After (1) and (2) a second try to write to the Slave is failing.

(1) and (3) are same commands and I am expecting the command sequence and response of (1) and (3) to be the same. But (3) is failing.

Is it mandatory to stop(reset) the I2C after the Master reads from the Slave??
If yes, who should do the reset of the I2C, the Master or the Slave?

Can someone who worked with I2C help me out?

Thank you,
Pradeep

Outcomes