So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Herrero
#90931 Hi,

I have problem with using I2C on default pins (D1 and D2) when D0 (GPIO16) is set as output. To GPIO16 is connected mosfet transistor to drive two LEDs. Generally GPIO16 works well - I'm able to turn on and turn off LEDs. The problem is with I2C. When I set the D0(GPIO16) as output the I2C interface stops working. I'm not able to communicate with other sensors. If I again set D0 as INPUT, I2C is working again. Why GPIO16 interfere with I2C? How to workaround this problem? The schema of my device is in attachement.
You do not have the required permissions to view the files attached to this post.
User avatar
By btidey
#90932 GPIO16 is different to the other GPIO as it is part of the RTC module where deep sleep uses it to wake up the cpu. It therefore uses calls to control it rather than being a directly accessible register and is significantly slower to read and write. See https://www.espressif.com/sites/default ... nce_en.pdf section 2.2.5

As I2C is implemented in software it might be that the GPIO16 operations could disrupt this for higher i2c speeds. Try lowering i2c speed if you can or avoid using the pin during i2c operations.