I2C Pull-up resistance design to prevent NACK's
Posted: Sun Mar 23, 2025 9:02 pm
Hi all,
I just started working with a ESP32-C3-MINI-1-H4 chip as part of a custom board that was designed. The primary point of focus is the I2C connection/communication with an IMU sensor. I set up a basic I2C communication program, even to use the i2c_master_probe() function as part of the "driver/i2c_master.h" header. However, I get an error with this, an any attempt to read the IMU with i2c_master_receive() failed with a ESP_ERR_TIMEOUT, which based on the ESP32 I2C documentation here, "If you get ESP_ERR_TIMEOUT while xfer_timeout_ms was parsed correctly, you should check the pull-up resistors." https://docs.espressif.com/projects/esp ... 2c%20start
After enabling the internal pullups in the i2c_master_bus_config with .flags.enable_internal_pullup = true, I know get ESP_ERR_NOT_FOUND, and an error for I2C hardware NACK detected. My current implementation is using 10K pull-up resistors on both SDA and SCL. I am wondering the pull-up resistors are too high of an impendence and is causing the NACK's, since enabling the internal pull-up resistors would drop the equivalent resistance to 8.18kOhms.
My math says based on the typical current sink of 28mA in the esp32 chip via the datasheet and the Vlow of .3*Vdd and Vhigh of .7*Vdd from the esp32 I2c design documentation and my input voltage of 3.3V, that the pull-up resistors should be 86 Ohms, which seems very low. In fact, the I2C documentation specifies that the pull-up resistors should be between 1k and 10k.
Anyone have any ideas?
I just started working with a ESP32-C3-MINI-1-H4 chip as part of a custom board that was designed. The primary point of focus is the I2C connection/communication with an IMU sensor. I set up a basic I2C communication program, even to use the i2c_master_probe() function as part of the "driver/i2c_master.h" header. However, I get an error with this, an any attempt to read the IMU with i2c_master_receive() failed with a ESP_ERR_TIMEOUT, which based on the ESP32 I2C documentation here, "If you get ESP_ERR_TIMEOUT while xfer_timeout_ms was parsed correctly, you should check the pull-up resistors." https://docs.espressif.com/projects/esp ... 2c%20start
After enabling the internal pullups in the i2c_master_bus_config with .flags.enable_internal_pullup = true, I know get ESP_ERR_NOT_FOUND, and an error for I2C hardware NACK detected. My current implementation is using 10K pull-up resistors on both SDA and SCL. I am wondering the pull-up resistors are too high of an impendence and is causing the NACK's, since enabling the internal pull-up resistors would drop the equivalent resistance to 8.18kOhms.
My math says based on the typical current sink of 28mA in the esp32 chip via the datasheet and the Vlow of .3*Vdd and Vhigh of .7*Vdd from the esp32 I2c design documentation and my input voltage of 3.3V, that the pull-up resistors should be 86 Ohms, which seems very low. In fact, the I2C documentation specifies that the pull-up resistors should be between 1k and 10k.
Anyone have any ideas?