-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wire.Begin(4,0) doesn't seem to work: Can GPIO0 mux with I2C clock(SCL)? #1236
Comments
@terryjmyers check through all of your libraries that use I made a fix for my repo, but I haven't merged it yet. To fix it, in Wire.cpp at TwoWire::begin() replace the two if(sdaPin < 0) { // default param passed
if(num == 0) {
if(sda==-1) sdaPin = SDA; //use Default Pin
else sdaPin = sda; // reuse prior pin
}
else {
if(sda==-1) {
log_e("no Default SDA Pin for Second Peripheral");
return; //no Default pin for Second Peripheral
}
else sdaPin = sda; // reuse prior pin
}
}
if(sclPin < 0) { // default param passed
if(num == 0) {
if(scl==-1) sclPin = SCL; // use Default pin
else sclPin = scl; // reuse prior pin
}
else {
if(scl==-1){
log_e("no Default SCL Pin for Second Peripheral");
return; //no Default pin for Second Peripheral
}
else sclPin = scl; // reuse prior pin
}
} Chuck. |
@stickbreaker Anyway I did again verify that my library is functional and I have full control over my peripherals no matter what combination of GPIO pins I choose for SCL and SDA, however I simply cannot get GPIO0 to function as SCL. |
are you using the the same library you referenced ADS1115-Lite Chuck. |
@terryjmyers What circuit do you have attached to GPIO 0? Check out this page on standard boot loader configurations ESP32 Boot Mode Selection The reason I point this out is, because the 'recommended' connection directly connects DTR from the usb-serial converter to GPIO0? Chuck. |
Fixed with I2C core RC1, boot strapping pin problem |
it seems I have the same issue at espidf. how was that fixed? |
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:
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 :).
The text was updated successfully, but these errors were encountered: