ESP32 default I2C pins?
ESP32 default I2C pins?
I am getting very conflicting information about the default I2C pins on the ESP32, everywhere I read says the default I2C0 pins are GPIO21 and GPIO22 for SDA and SCL respectively but the following screenshot from the datasheet seems to suggest otherwise
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 default I2C pins?
The hardware doesn't define any default pins: the GPIO matrix carries the I2C signals but they're not sent out to any GPIO on startup; software can however use any (compatible and not otherwise used) GPIO to put the I2C signals on. I think software like Arduino does use certain IO pins when you don't specify them yourself; that could be the 21 and 22 you're referring to.
Re: ESP32 default I2C pins?
You say the hardware doesn't define the default pins, I know most interfaces can be reassigned to any GPIO but most of them have dedicated/default pins such as UART, SPI, SDIO, USB (ESP32-S3), etc.
Are you saying that the two I2C interfaces on the ESP32 do not have dedicated pins at all, and that GPIO21 and GPIO22 were merely arbitrary "defaults" set by the IDE?
Are you saying that the two I2C interfaces on the ESP32 do not have dedicated pins at all, and that GPIO21 and GPIO22 were merely arbitrary "defaults" set by the IDE?
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 default I2C pins?
Yes. I2C isn't alone in this: from memory I2S, PCNT, MCPWM, Ethernet, one of the UARTS and the LEDC also don't have 'default' GPIOs.
Re: ESP32 default I2C pins?
Just for accuracy, most of the RMII EMAC peripheral pins are fixed.
Who is online
Users browsing this forum: No registered users and 44 guests