I have been stuggling to get a simple keyes oled module to function.
module is a https://www.fasttech.com/products/0/10011357/1977809-0-96-oled-high-clear-module-board-for-arduino
At first I figured it was a code or address problem but I had tried UG8LIB, adafruits ssd1306 library and just good old Wire and all left me with the same random garbage on the display.
I tried 3.3v and 5v power and was almost at the point of concluding I had a dodgy display when I connected a little saleae (clone) logic analyser to the i2c to probe the lines and magically the display then worked fine with all the assorted test codes.
once initialised, you can unplug the logic analyser and it will continue to run hassle free with no visible corruption. so it seems to be just the initialisation commands that are being received incorrectly.
now on the same i2c lines I also have a compass chip. this has worked fine.
the compass (GY-273 module) has an onboard 3.3v reg and the i2c pullups on it are 5.1k to the stepped down 3.3v.
the LCD module claims to be ok on 5v and it has pullups of 10k to the 5v rail.
It works with or without the compass module attached with the logic analyser, all that needs to be probed is the clock line, data is not required.
ACK is being received fine whether or not the init code has functioned.
I added a result error check on wire.transmit ..
byte result = Wire.endTransmission(); // stop transmitting
if (result) Serial.print(result);
and this never prints so long as address is correct.
at one stage I attached some long wires to the clock to a variable resistor wheel and the lcd would init fine when 47k to ground was selected, soldering a 47k resistor between SCLK and ground however proved fruitless.
soldering a 200pF cap between SCLK and ground means lcd will not init with or without logic analyser, still error free i2c comms though, at least the ack is received for the correct address.
I am now pretty much at a loss on what is actually going astray. scope puts clock rise times at 320nS and peak of 3.7v with or without the saleae attached. I can not see any change to the clock, its not noisy, looks fine.
any ideas to try ?
I am considering bit banging the i2c to see if I can track it down..
I was going to write some data to the lcd and then read it back as a test but the ssd1306 data specifies that " No data read is provided in serial mode operation. "
simply using an arduino nano hanging in mid air powered off the USB, the lcd connected via standard 6" wires, I separated the clock and data lines from the 4 wire loom to see if crosstalk was a problem.
I see people mentioning wire lengths of many metres running 100kHz i2c so I do not think they are the problem..
I just took the 3.3v from the compass module and am using that to power the LCD, added a 1uF cap between vcc and ground. display now will not init with or without analyser connected.
tried adding a delay up to 1mS after every i2c transmit.
this is doing my head in..
Now i do not even care what is wrong, I just want it sorted so i can move on..