AnsweredAssumed Answered

STM32L0 I2C: Can NBYTES[7:0] be changed to a NEW value when TCR flag is high?

Question asked by Pieter Conradie on Apr 16, 2018

Hi everyone,

 

I am trying to break up an I2C transaction into segments, e.g. begin with START condition and transmit 2 bytes, then transmit 4 bytes, then transmit 1 byte and end with STOP condition.

 

From my experiments it looks like the NBYTES value (e.g. 2) is latched when the START condition is triggered.

When I wait for TCR flag and set NBYTES to the next value (e.g. 4), the I2C peripheral resets the TCR flag, but it looks like the first value (e.g. 2) is used and not the new value (e.g. 4), even though I can read back NBYTES and it equals the new value (4).

 

Does this mean that it is impossible to break up an I2C transaction into arbitrary segments? Is there a solution / workaround?

 

Thanks in advance,

Pieter

Outcomes