cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 I2C send NACK if received byte == 0

moritz_noeltner
Associate II
Posted on May 13, 2015 at 13:26

Hi everyone,

I want to interface an STM32F429IIT to a SI4735 radio chip using the I2C interface. The SI4735 programming manual says, the status bytes should be read after sending a command.

My problem is, that the first status byte may be zero (or at least one certain bit may be zero) which indicates the remaining status bytes are not ready for reading. In this case, the system controller (in my case the STM32) should send a NACK after the reception of the first byte and end the transmission.

How can I do this? To my understanding, the ACK bit in CR1 has to be cleared before reception of a byte in order to send a NACK when it is received.

Best regards,

Moritz N�ltner

#stm32f4 #i2c #discovery
3 REPLIES 3
moritz_noeltner
Associate II
Posted on May 13, 2015 at 13:39

And of course, if the first status byte is non-zero (or the specific bit is non-zero) the communication should continue, so I cannot just clear the ACK bit in CR1 before reception of the first byte...

moritz_noeltner
Associate II
Posted on May 15, 2015 at 13:16

Anybody?

tescaflown
Associate II
Posted on May 15, 2015 at 14:27

on my aknoledge of I2C and STM32F1xx, since the I2C is buffered 2bytes and as soon you read the input register, the next step is performed. So that's not possible to choose to enable or disable the ACK after reading the received byte. You have to choose before.

But it doesn't care. Read you received byte, choose to enable or disable the ACK. You will just received dummy data from your device. If it has a good I2C, while it don't have the NACK, it will continu to send something.

Best regards,