I2C Custom Driver - ESP32-S3

DigitalTurtle
Posts: 1
Joined: Sat Dec 27, 2025 7:43 pm

I2C Custom Driver - ESP32-S3

Postby DigitalTurtle » Sat Dec 27, 2025 8:07 pm

I am attempting to make a custom driver for the i2c peripheral on the ESP32-S3. I am using the technical document as a guide: https://documentation.espressif.com/esp ... ual_en.pdf

I went through the GPIO and I2C chapters and set the config registers accordingly, and the SCL line is constantly high (I can see the SDA line changing when I set the command registers).

I have made sure to set the SYSTEM_PERIPHERAL_CLK_EN register and reset the SYSTEM_PERIPHERAL_RST_EN registers to be able to modify the internal registers for the i2c peripheral.

I am using pin 7 for the SCL line and pin 8 for the SDA line.

The board is connected to an MPU-6050, which already has pull-up resistors.

Is there anything else I need to configure for the SCL line to be active?
esp32.jpg
esp32.jpg (2.52 MiB) Viewed 1099 times

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: I2C Custom Driver - ESP32-S3

Postby MicroController » Sun Dec 28, 2025 11:46 am

I went through the GPIO and I2C chapters and set the config registers accordingly ... (I can see the SDA line changing ...)
Assuming that SDA is actually putting out I2C data, you'll have to double-check the SCL config: Signal routing (IOMUX,GPIO matrix), output enable, open drain. And make sure there's no other GPIO or peripheral setup happening for that pin afterwards which would 'steal' the pin from the I2C.

(Btw, for convenience I just kept all the config&setup stuff from the 'legacy' I2C driver as-is and only replaced the actual transaction handling (API+ISR) to suit my needs.)

Who is online

Users browsing this forum: Baidu [Spider], Qwantbot and 6 guests