Page 1 of 1

Using GPIO0 and GPIO4 for SCL/SDA ssd1306

PostPosted: Tue Aug 02, 2022 6:48 am
by Kevje4
Hello all!

I accidentally messed up my pcb design and connected the SSD1306 SCL on D3(GPIO0) instead of D1(GPIO5), SDA is on D2(GPIO4). I understand that GPIO0 is to be avoided and has with boot modes to do, but since i already have the pcb's im hoping there is a way to save this.

For testing i am using the Adafruit SSD1306 test sketch which i added "Wire.begin(4,0);" to void.setup. However i am only able to get a quick flash of the adafruit logo on the screen when i press button before it goes black again.

Any help would be much appreciated.

Re: Using GPIO0 and GPIO4 for SCL/SDA ssd1306

PostPosted: Thu Aug 04, 2022 6:07 am
by rooppoorali
As far as I can remember, the adafruit logo shows every time when the display is powered up or reset. If there is any problem with the connection or code, still it will appear. Printing your PCB again looks like the only option to me. Disconnecting the tracks running from GPIO0 and GPIO4 to the display, and soldering jumpers from the desired GPIO pins to the display can be an option too. Let's see if anyone says otherwise.

Re: Using GPIO0 and GPIO4 for SCL/SDA ssd1306

PostPosted: Thu Aug 04, 2022 8:56 am
by btidey
It should be possible to make this work with those pins.

GPIO0 does need to be high during the initial boot but the I2C pull up will be OK for this. GPIO4 sis afree GPIO with no requirements at boot.

When you put Wire with pins defined in setup this will get overwritten by the Wire.begin in the library which then uses the default I2C pins (4.5).

If you set the periphBegin parameter in the library begin call to false then it will skip that and use the pins you have already defined for Wire. Note that periphBegin is the optional last parameter in the begin call and defaults to true if not present.