I2C on GPIO 0 + 2
Moderators: grovkillen, Stuntteam, TD-er
I2C on GPIO 0 + 2
Have anyone success with using GPIO 0 and 2 for I2C?
I have tried configuring GPIO 0 for SCL and GPIO 2 for SDA. This results on the module hanging in the I2C INIT during reboot. I can't even enter any commands and I need to overwrite flash to recover the module. The same pin usage for I2C works with the russian software from www.wifi-iot.ru so it's not a hardware limitation (currently I am testing without any sensors on the I2C bus - just needed to change the default I2C values and decided to go with the values from my wifi-iot modules)
- Jan
I have tried configuring GPIO 0 for SCL and GPIO 2 for SDA. This results on the module hanging in the I2C INIT during reboot. I can't even enter any commands and I need to overwrite flash to recover the module. The same pin usage for I2C works with the russian software from www.wifi-iot.ru so it's not a hardware limitation (currently I am testing without any sensors on the I2C bus - just needed to change the default I2C values and decided to go with the values from my wifi-iot modules)
- Jan
Jan Chrillesen, Denmark
-
- Normal user
- Posts: 103
- Joined: 16 Sep 2015, 20:32
Re: I2C on GPIO 0 + 2
I have tried it once but I had the same problem.
I use an E12 so no lack on pins and I decided to go back to the default for ESP Easy.
I tried it because of this forum
http://www.esp8266.com/viewtopic.php?p=24793#p24793
Forumpost over Flash, GPIO2, 0 and 15 rehash.
I use an E12 so no lack on pins and I decided to go back to the default for ESP Easy.
I tried it because of this forum
http://www.esp8266.com/viewtopic.php?p=24793#p24793
Forumpost over Flash, GPIO2, 0 and 15 rehash.
Re: I2C on GPIO 0 + 2
I am aware that 0, 2 and 15 should be avoided if possible - however I am building a lab/test setup, where I need to add as many different sensors as possible and I need all usable GPIO pins for this. I think I'll go search the Arduino forums to see if there's a generic issue with I2C and GPIO 0/2 - thanks for confirming that I'm not alone on this issue!NietGiftig wrote:I have tried it once but I had the same problem.
I use an E12 so no lack on pins and I decided to go back to the default for ESP Easy.
I tried it because of this forum
http://www.esp8266.com/viewtopic.php?p=24793#p24793
Forumpost over Flash, GPIO2, 0 and 15 rehash.
- Jan
Jan Chrillesen, Denmark
Re: I2C on GPIO 0 + 2
My development lab has switched to NodeMCU V1 a while ago. But when we started on the first ESP firmware (wasn't even ESP Easy) we used ESP-01 with I2C on GPIO-0 and GPIO-2. So it has worked before and probably could still work on ESP Easy.
Have to get one of those classic modules running again in the testlab and see if we have broken something here...
Have to get one of those classic modules running again in the testlab and see if we have broken something here...
Re: I2C on GPIO 0 + 2
Just connected an ESP-01 onto the I2C bus and it seems to work without issues here:
- Attachments
-
- I2C_Scan.png (5.29 KiB) Viewed 30156 times
Re: I2C on GPIO 0 + 2
That's weird - I repeated the test today, with a PCF8591 board connected to the bus and it worked fine. After removing the board the board still boots. Sorry for the false alarm.Martinus wrote:Just connected an ESP-01 onto the I2C bus and it seems to work without issues here:
- Jan
Jan Chrillesen, Denmark
Re: I2C on GPIO 0 + 2
Also working here on a ESP8266 Dev Board .
Re: I2C on GPIO 0 + 2
Hi,
I think, that the problem may be related to the fact, that during RESET the GPIO0 has a special function - it causes ESP8266 to enter the flashing mode.
If you have an I2C CLK line with relatively high capacitance connected to it, I'm afraid that during power-up the ESP8266 may go into the flashing mode.
Even if you connect the I2C bus after the module started, there is still a risk that reset occurs when a peripheral holds CLK down (due to clock stretching).
Regards,
Wojtek
I think, that the problem may be related to the fact, that during RESET the GPIO0 has a special function - it causes ESP8266 to enter the flashing mode.
If you have an I2C CLK line with relatively high capacitance connected to it, I'm afraid that during power-up the ESP8266 may go into the flashing mode.
Even if you connect the I2C bus after the module started, there is still a risk that reset occurs when a peripheral holds CLK down (due to clock stretching).
Regards,
Wojtek
Re: I2C on GPIO 0 + 2
Hi,
what is the best solution to use I2C on the ESP-01 Module??
GPIO0 SDA and GPIO2 SCL
or
GPIO0 SCL and GPIO2 SDA
what is the best solution to use I2C on the ESP-01 Module??
GPIO0 SDA and GPIO2 SCL
or
GPIO0 SCL and GPIO2 SDA
Re: I2C on GPIO 0 + 2
Like WZab says, if you use I2C on pin GPIO-0 there is always the risk that a device that can talk to the ESP will pull this line down.
I never had problems when connecting a listening-only device like an OLED or LCD on GPIO-0 but when using a device that can pull down this pin you can expect problems. After an ESP reset, a I2C talking-device may pull down any of the 2 lines if it was busy talking to the ESP when the reset occurred. You can only overcome this by resetting the I2C device at the same time as resetting the ESP
edit: In my setup with a display on GPIO-0/2 I used pullups of 3k3 and the lines were shorter that 20 cm. So capacitance was never a problem.
I never had problems when connecting a listening-only device like an OLED or LCD on GPIO-0 but when using a device that can pull down this pin you can expect problems. After an ESP reset, a I2C talking-device may pull down any of the 2 lines if it was busy talking to the ESP when the reset occurred. You can only overcome this by resetting the I2C device at the same time as resetting the ESP
edit: In my setup with a display on GPIO-0/2 I used pullups of 3k3 and the lines were shorter that 20 cm. So capacitance was never a problem.
Re: I2C on GPIO 0 + 2
Even listening-only devices can pull down the SDA line, when signalling ACK to the master.
Who is online
Users browsing this forum: Google [Bot] and 4 guests