2024-02-18 10:08 PM
Hi all,
I want to drive Humidity and Temperature Sensor SHT4x(address is 0x44).
I finished the driver code in STM32F103C8 with HAL lib, but when I used the same driver code in STM32F429IG with HAL lib, the HAL_I2C_Master_Transmit() always returned HAL_ERROR. After debugging, the error comes from the following code:
This topic said the reason is the I2C master did NOT receive the ACK by slave.
But I catch the signal by an oscilloscope, and it seems the sensor already ACK:
I try to send the command 0xFD(measure T & RH with high precision), MCU should write the device addr, following by the command, but here just the device address.
What happened, please help me! Thanks a lot.
2024-02-19 05:37 AM
Sometimes the slave will NACK the last byte of the transfer which can lead to this issue. A logic analyzer capture of the full transaction would clear things up.