2024-10-12 11:50 AM
Hello,
I'd like to have this feature implemented: if no data is to be sent, the I2C peripheral (in the slave mode) should not perform an ACK in case of an address match.
Of course, this wouldn't have to be an issue, if, for example, no data is ready, the interrupt routine would respond with a "no data" answer, for example sending 0xFF. However, I'm working with a codebase, where this behavior is not desired.
I was thinking about configuring the I2C peripheral in this way:
setting the SBC bit to 1 - if NBYTES=0 and the slave is addressed to send data to the master, what happens in this case?
Thank you in advance.
2024-10-12 12:28 PM
Maybe, disable the I2C while no data is ready? This is behavior of some I2C devices that do not stretch the clock: while busy they do not respond to addressing thus "replying NACK".
2024-10-12 12:54 PM - edited 2024-10-12 12:54 PM
Unfortunately, this is not a solution. I need to be able to receive data too. My initial idea was that the peripheral would not respond if requested to send data while SBC=1 and NBYTES=0. If requested to receive data while SBC=1, the NBYTES could be reloaded to 0x01 (as 28.4.8 Slave byte control mode, RM0365 suggests).