According to the datasheets, ESP32 has two i2c interfaces.
And one set of pins corresponding is (21,22).
What's the other pin set that can be used for the second i2c interface? Are they also dedicated or any GPIO pin can be configure as I2C?
Cheers.
I2C Pins.
Re: I2C Pins.
I think 21,22 work with arduino.
for esp-idf there is an example at https://github.com/espressif/esp-idf/tr ... herals/i2c
for esp-idf there is an example at https://github.com/espressif/esp-idf/tr ... herals/i2c
Re: I2C Pins.
Both I2C interfaces are connected to pins via GPIO matrix, so you can select arbitrary IOs for SDA and SCL. Just observe the constraints of each pin, such is I/O capability, bootstrapping function, and so on. See "ESP32 Chip Pin List" document for details.
Re: I2C Pins.
ESP_igr,
Thanks for the lead, this is what i was trying to confirm.
Thanks again.
Thanks for the lead, this is what i was trying to confirm.
Thanks again.
Re: I2C Pins.
Hi
Im using PIN34 (SDA )and 35 (SCL) for i2c interface. Getting following errors
E (723) i2c: C:/esp/esp-idf/components/driver/i2c.c:606 (i2c_set_pin):sda gpio number error
ESP_ERROR_CHECK failed: esp_err_t 0x102 at 0x400d1d70
file: "C:/esp/esp-idf/examples/esp_i2c/i2c_scanner/main/main.c" line 36
func: app_main
expression: i2c_param_config(I2C_NUM_0, &conf)
Backtrace: 0x40086c44:0x3ffb40d0 0x40086fa9:0x3ffb40f0 0x400d1d70:0x3ffb4110 0x400d086f:0x3ffb4160
When i changed the pins to other I/O it works fine. Is there any limitation in using pins 34-39 for i2c as manual says any GPIO.
Pl help me.
Im using PIN34 (SDA )and 35 (SCL) for i2c interface. Getting following errors
E (723) i2c: C:/esp/esp-idf/components/driver/i2c.c:606 (i2c_set_pin):sda gpio number error
ESP_ERROR_CHECK failed: esp_err_t 0x102 at 0x400d1d70
file: "C:/esp/esp-idf/examples/esp_i2c/i2c_scanner/main/main.c" line 36
func: app_main
expression: i2c_param_config(I2C_NUM_0, &conf)
Backtrace: 0x40086c44:0x3ffb40d0 0x40086fa9:0x3ffb40f0 0x400d1d70:0x3ffb4110 0x400d086f:0x3ffb4160
When i changed the pins to other I/O it works fine. Is there any limitation in using pins 34-39 for i2c as manual says any GPIO.
Pl help me.
Re: I2C Pins.
34-39 input onlyESP_igrr wrote:Both I2C interfaces are connected to pins via GPIO matrix, so you can select arbitrary IOs for SDA and SCL. Just observe the constraints of each pin, such as I/O capability, bootstrapping function, and so on. See "ESP32 Chip Pin List" document for details.
Re: I2C Pins.
Hi
Now due to the constrain on pin 34-39 as input only i have changed my interface to pin 18 (SCL) and 19 (SDA) and running i2cscanner program to get the device address. I have 24CXX device breakout board and trying to get address printed , am using ESP32 DevKitC and esp-idf. The program run for complete iteration(0-127) but no address is displayed. Then tried with different pins like 21,22 ; 16,17 but no luck at all. What am i missing. the code which im running is in below link
https://github.com/nkolban/esp32-snippe ... 2c/scanner
Kindly help me out as i have to use this understanding to interface with IO expander ( Any suggestion on io expander with esp-idf will be good start ) .
Now due to the constrain on pin 34-39 as input only i have changed my interface to pin 18 (SCL) and 19 (SDA) and running i2cscanner program to get the device address. I have 24CXX device breakout board and trying to get address printed , am using ESP32 DevKitC and esp-idf. The program run for complete iteration(0-127) but no address is displayed. Then tried with different pins like 21,22 ; 16,17 but no luck at all. What am i missing. the code which im running is in below link
https://github.com/nkolban/esp32-snippe ... 2c/scanner
Kindly help me out as i have to use this understanding to interface with IO expander ( Any suggestion on io expander with esp-idf will be good start ) .
Re: I2C Pins.
I2C_SDA - MTDO - GPIO15
I2C_SCL - GPIO2
I2C_SDA - GPIO0
I2C_SCL - GPIO4
I2C_SCL - GPIO2
I2C_SDA - GPIO0
I2C_SCL - GPIO4
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: I2C Pins.
@satish: Do you have external pull-ups for those I2C pins? If so, can you connect a logical analyzer or oscilloscope to these pins and see what signals are there? FWIW: Both 21/22 and 16/17 should work fine on a DevkitC.
Who is online
Users browsing this forum: No registered users and 262 guests