Default I2C pins on ESP32-3C
Default I2C pins on ESP32-3C
Hi. This is my first post here. Be gentle.
I've been experimenting with AiThinker ESP32-3CF and 3CU modules. The datasheets for these both show the flash download strapping pins being GPIO8 and 9.
Now, here's the pins.h file for the ESP32-C3 variant:
https://github.com/espressif/arduino-es ... _arduino.h
This specifies the I2C SDA and SCL pins also as GPIO8 and 9. I get that you're not going to be doing any I2C during flashing, but still, is this wise? There's going to be other hardware wired to those pins. Would it be better to use something like GPIO18 and 19?
Apologies if this has been discussed before. I did try searching the forum but the search didn't work :/
I've been experimenting with AiThinker ESP32-3CF and 3CU modules. The datasheets for these both show the flash download strapping pins being GPIO8 and 9.
Now, here's the pins.h file for the ESP32-C3 variant:
https://github.com/espressif/arduino-es ... _arduino.h
This specifies the I2C SDA and SCL pins also as GPIO8 and 9. I get that you're not going to be doing any I2C during flashing, but still, is this wise? There's going to be other hardware wired to those pins. Would it be better to use something like GPIO18 and 19?
Apologies if this has been discussed before. I did try searching the forum but the search didn't work :/
-
- Posts: 364
- Joined: Mon Jan 04, 2021 2:06 pm
Re: Default I2C pins on ESP32-3C
Thanks for replying. Are you saying that GPIO8 and 9 are fine to use with I2C, or that I can easily change which pins I use, or both?
If it's the former, I think you're right - but I've not tested it. I have already used different pins in my project to avoid any issues.
If it's the latter (as using 8 and 9 might cause problems if you also have I2C devices connected), then specifying different pins as the default in the pins.h file would make more sense, wouldn't it?
If it's the former, I think you're right - but I've not tested it. I have already used different pins in my project to avoid any issues.
If it's the latter (as using 8 and 9 might cause problems if you also have I2C devices connected), then specifying different pins as the default in the pins.h file would make more sense, wouldn't it?
-
- Posts: 364
- Joined: Mon Jan 04, 2021 2:06 pm
Re: Default I2C pins on ESP32-3C
If you take a look at the datasheet, you'll see the strapping pins table (see image):
This means that both GPIO's 8 and 9 can be used for I2C, since you'll have the pullups required by the I2C. The best to do is to test this on your board and see the results. Probably this gonna work.
The GPIO8 will not make any difference by adding the pullup resistor if you haven't changed the eFuse configuration.
This means that both GPIO's 8 and 9 can be used for I2C, since you'll have the pullups required by the I2C. The best to do is to test this on your board and see the results. Probably this gonna work.
The GPIO8 will not make any difference by adding the pullup resistor if you haven't changed the eFuse configuration.
Re: Default I2C pins on ESP32-3C
Yup, that makes sense.
Thanks for taking the time to reply so fully - I appreciate it.
Thanks for taking the time to reply so fully - I appreciate it.
Re: Default I2C pins on ESP32-3C
Can I add an additional question regarding the strapping PINs?
The technical reference manual(ch 7.2) states IO2 should pulled high for SPI-Boot as well as Download-Boot.
However I couldn't find any information what happens if the Bit is not read "1"?
Furthermore, the DevKitM-1 does not pull this pin up or down, but routes it to the header.
Therefore I'd really like to know for what I can use IO2 for. And if it must not be read low, if i can disable this behavior using e-fuses?
Thanks!
The technical reference manual(ch 7.2) states IO2 should pulled high for SPI-Boot as well as Download-Boot.
However I couldn't find any information what happens if the Bit is not read "1"?
Furthermore, the DevKitM-1 does not pull this pin up or down, but routes it to the header.
Therefore I'd really like to know for what I can use IO2 for. And if it must not be read low, if i can disable this behavior using e-fuses?
Thanks!
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Default I2C pins on ESP32-3C
I don't have the documentation here, but from memory it boots up in a mode that is used for chip testing in the factory. You can still use this pin; you simply must make sure that the chip reads a high level on bootup/reset. As soon as the chip is running, you can use it as any other GPIO.
Re: Default I2C pins on ESP32-3C
I think GPIO 8/9 for I2C is indeed dangerous.
I tried scanning the I2C bus with a OLED attached, and I am now left with a corrupted board, that spews this in a never ending stream:
Can the device be revived, or do I need to throw it out?
I tried scanning the I2C bus with a OLED attached, and I am now left with a corrupted board, that spews this in a never ending stream:
Code: Select all
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd6100,len:0x420
load:0x403ce000,len:0x90c
load:0x403d0000,len:0x236c
SHA-256 comparison failed:
Calculated: ccb0d00bac7e84e1d90a12e4f75f4ab6c5f7e71bb209afd5819c4c9557a6db71
Expected: c9cf160580940ec7801c73b16423824e72ad12055c732e83ce66332240af42a7
Attempting to boot anyway...
entry 0x403ce000
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Default I2C pins on ESP32-3C
You should be able to simply reflash it; does that not work?
Re: Default I2C pins on ESP32-3C
Reflash, as in reprogram?ESP_Sprite wrote: ↑Sat Jan 15, 2022 3:43 amYou should be able to simply reflash it; does that not work?
When I build and upload a new program, I get the same issue. I use arduino ide.
Can I reflash the bootloader, maybe? If so, how?
Who is online
Users browsing this forum: No registered users and 135 guests