Hello,
I've observed that when I:
- set I2CMDR = IRS | MST | TRX | STT
- set I2CCNT 2
- write 2 bytes
- then wait for ARDY and clear it
- then set I2CCNT to X, X>0
- set I2CMDR anew for TX, this time with STT=0 (since we already sent one) but SCD=1 (so I get a stop condition at the end)
The last step immediately generates a stop condition, which would hint that the internal data counter is still zero.
I played around some more and it seems I2CCNT gets written into internal data counter when generating start condition. (That's just a speculation, but feel free to confirm or correct me)
Unfortunately start condition resets my device's bus cycle so I can't really use repeated start condition.
I don't really have a problem with making it work, I'm more trying to make it pretty by separating address phase from data phase in code.
So my question is:
Is there a way to write internal data counter without generating start condition?
It's ok if the answer is no.
Thank you