2.42" 128x64 I2C OLED screen

Post Reply
solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

2.42" 128x64 I2C OLED screen

Post by solarmon » Sun Mar 10, 2019 2:53 pm

EDIT: Sorry - maybe this should have gone in the "New Alpha version Firmware - Volunteer Testers needed!" thread?

Hi,

I'm trying to get this 2.42" 128x64 I2C OLED screen working with HxC on a Gotek:

Image

This has been wired up to be I2C, and the RES pin has been pulled up to 3.3V (with no resistors).

I have used the v3.1.38.1a custom firmware (https://hxc2001.com/custom_fw/) and the only OLED Screen Setup option that seems to get the display to sort of work is:

OLED 128x64 (Noname) SH1106 i2c 0x78

The other settings are kept as default.

However, it only boots to show and stay at the splash screen:

Image

Sometimes it starts up with this corrupted screen:

Image

Do I need to do anything else to get it to proceed further with the boot up?

(Imgur images: https://imgur.com/a/f4R83Fn)

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Sun Mar 10, 2019 11:58 pm

Can you try this firmware and tell me what you got ?:
https://hxc2001.com/vrac/HxCUSBFE.UPD

for the random screen i suspect that this is a reset issue. some screens need an external reset signal. this is the "RES" pin here. An "RC" circuit may be enough to reset the screen.

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 12:43 am

See the comments on this :
http://tnorbert.com/blog/2018/03/15/ssd ... ay-wiring/
This sound quite similar to your issue.

<<I boot up my arduino with the display connected, everything works fine for about 5 seconds. then the display just freezes.>>

<<And you should read the comments under this one. You need to start with RES low and then pull it high.>>

<<I cracked it! Decided to go and actually read the docs since I wasn't sure what the RES pin does. This was the key: "When the pin is pulled LOW, initialization of the chip is executed. Keep this pin pull HIGH during normal operation." It needs to start low to initialize and then get flipped to high. So I connected RES to GND via the 10K then to a digital pin on the ESP. The sketch then starts the pin low and then switches it to high right before the display is initialized. Now it works perfectly every time!>>

You should add a RC circuit on the RES pin with R set around 4.7kohms and C arount 4.7uF....

solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

Re: 2.42" 128x64 I2C OLED screen

Post by solarmon » Mon Mar 11, 2019 12:50 am

Hi,

Yes, I did already connect the OLED screen RES pin to 3.3v - this was the only way I could get it to show anything.

I tried the firmware, but it gave this:

Image

And plugging in the smaller 0.96" 128x32 OLED screen instead:

Image

Image

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 12:56 am

solarmon wrote:
Mon Mar 11, 2019 12:50 am
Hi,

Yes, I did already connect the OLED screen RES pin to 3.3v - this was the only way I could get it to show anything.
This is not enough to make it reliable. The RES signal need to be low some milliseconds to reset properly the screen at power up.

Thanks for the picture. In some minutes a new firmware to test ;)

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 1:00 am


solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

Re: 2.42" 128x64 I2C OLED screen

Post by solarmon » Mon Mar 11, 2019 1:12 am

With the new test firmware, the screen is not corrupted, but it just stays on that screen:

Image

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 1:15 am

solarmon wrote:
Mon Mar 11, 2019 1:12 am
With the new test firmware, the screen is not corrupted, but it just stays on that screen:

Image
Ok the config is fine now.

Now the freeze issue : do you power it with 5V or 3.3V ?

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 1:29 am


solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

Re: 2.42" 128x64 I2C OLED screen

Post by solarmon » Mon Mar 11, 2019 1:33 am

I use 3.3V pin on the Gotek.

I currently use the RST, J4/RX or TX pin which all seem to be 3.3V - not sure how stable these actually are.

I suppose could also connect to the VCC pin of the screen itself, which is 3.3V.

I've tried with a 5V pin (next to J4/RX), but this does not seem to work for this screen.

Image

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 1:37 am

solarmon wrote:
Mon Mar 11, 2019 1:33 am
I use 3.3V pin on the Gotek.

I currently use the RST, J4/RX or TX pin which all seem to be 3.3V - not sure how stable these actually are.

I suppose could also connect to the VCC pin of the screen itself, which is 3.3V.

I've tried with a 5V pin (next to J4/RX), but this does not seem to work for this screen.

Image
ok i see, so you have connected the gotek RST/RX pin to the RES pin screen ? Don't do this, this is not stable. something is sent on the tx pin at power up ;).

solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

Re: 2.42" 128x64 I2C OLED screen

Post by solarmon » Mon Mar 11, 2019 2:05 am

Jeff wrote:
Mon Mar 11, 2019 1:29 am
I2C bus speed reduced :

https://hxc2001.com/vrac/HxCUSBFE3.UPD
This firmware causes, most of the time, some partial corruption:

Image

solarmon
Posts: 81
Joined: Tue Feb 26, 2019 9:38 am

Re: 2.42" 128x64 I2C OLED screen

Post by solarmon » Mon Mar 11, 2019 2:16 am

Jeff wrote:
Mon Mar 11, 2019 1:37 am
ok i see, so you have connected the gotek RST/RX pin to the RES pin screen ? Don't do this, this is not stable. something is sent on the tx pin at power up ;).
These were the most convenient pins I could find using Dupont jumper wires.

Actually, since I put in header pins for the L3, L4 and L5 LEDs, and I am not using the anode pins of them (I'm using the RGB Rotary Encoder LEDs, connected to the cathode pin), which are connected to 3.3V, I could use that. For example, the anode pin for L4, which is connected to 3.3V via 1K resistor, which actually turns it in to a pull up resistor:

Image

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 8:02 am

solarmon wrote:
Mon Mar 11, 2019 2:05 am
Jeff wrote:
Mon Mar 11, 2019 1:29 am
I2C bus speed reduced :

https://hxc2001.com/vrac/HxCUSBFE3.UPD
This firmware causes, most of the time, some partial corruption:

Image
In fact this is interesting : i just changed the freq from 100khz to 50khz : It just doesn't have time to fill up the memory screen before the screen "die". but in fact both firmware have the same problem.

Jeff
Site Admin
Posts: 6465
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: 2.42" 128x64 I2C OLED screen

Post by Jeff » Mon Mar 11, 2019 8:29 am

Ok to be sure to have a proper reset signal :

-> Disconnect the buzzer from JB (if present).
-> Connect the screen RES pin to the JB signal.
-> Update to this firmware : https://hxc2001.com/vrac/HxCUSBFE4.UPD

A proper Reset cycle of 200ms is done before initializing the screen on the JB pin.
This is 3.3V so you can connect it directly to the screen RES pin.

Post Reply