Skip to content

Wire.Begin(4,0) doesn't seem to work: Can GPIO0 mux with I2C clock(SCL)? #1236

Closed
@terryjmyers

Description

@terryjmyers

Hardware:

Board: ESP32-WROVER (bare module in small batch burn fixture)
Core Installation/update date: Some time in Jan 2018 (2 months ago)
IDE name: vstudio
Flash Frequency: 240Mhz(irrelevant)
Upload Speed: 926500 (irrelevant)

I want to use GPIO4 for SDA and GPIO0 for SCL. GPIO4 for SDA works fine (even up to 400Khz), tested by simplying assigning SCL to some other pin. However I'm unable to use GPIO0 as SCL. Of course I'm aware that GPIO0 is a boot strap pin, but this shouldn't matter if you are using it as an output (same with GPIO2. Besides, GPIO0 has an inbuilt Pull up resistor anyway so it makes sense for a SCL line.

Additional information:

  1. The bus has an MCP4725 and an ADS1115, both of which respond fine on any other "normal" GPIO pins with either 100Khz or 400Khz.
  2. I'm using external 1K pull up resistors as my capacitance is a bit high as I'm still in a breadboard and my bus lines are at least 12in long.
  3. With an OScope I'm able to see the transmission on "other" GPIO pin combination without any problem at both 100khz and 400khz speeds. e.g. I've tested: [SDA, SCL], [4,22], [21/22], [25/26], just to make sure it wasn't user error.
  4. I'm using GPIO2 (which is of course another boot strap pin with inbuilt pulldown) successfully as a PWM output to control a fan speed PWM line (generic 26Khz 4-pin fan control).

Is GPIO0 unable to mux itself into the clock line? Am I doing something wrong? I also realize this may be hard to reproduce as most dev boards don't give access to GPIO0. My sketch is quite extensive so its probably just easier for anyone to open an example sketch provided with any reliable I2C IC library( e.g. AdaFruit_mcp4725, AdaFruit_ads111x), and simply changing the Wire.Begin() in the librariers *.cpp file to Wire.Begin(4,0).

Thanks! Any assistance or verification of what I'm seeing would be much appreciated. Good luck breaking out GPIO0 :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions