olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
4.91k stars 1.03k forks source link

Blank bar and text mirrored on 256x64 SSD1322 OLED display #2386

Open spiderjuka opened 4 months ago

spiderjuka commented 4 months ago

Hi guys, I have exactly this same problem like lucasgomesgs0 - Blank bar on 256x64 SSD1322 OLED display

2379

image

My display is 256x64 SSD1322 2.7inch OLED after upload code to arduino white bar appears on the left side of display and the texts is mirrored. I used fix described by ucasgomesgs0 - in file u8x8_d_ssd1322.c I changed default_x_offset to 0x018 and second parameter of U8X8_CAA(0xa0, 0x06, 0x011), / Set Re-Map / Dual COM Line Mode / to 0x016. Finally I can confirm that that fix is working! Olikraus - but now question - is it possible to update your u8g2 library about that fix (for screen ssd1322)? Is it possible to make custome driver for ssd1322 display?

Thank you.

olikraus commented 4 months ago

So as a (more technical) summary, this are the required changes:

Change x offset from 0x01c to 0x018: https://github.com/olikraus/u8g2/blob/ec2559e8466dead8b13dd92cc17ac10e63dab6ac/csrc/u8x8_d_ssd1322.c#L260

Change this to U8X8_CAA(0xa0, 0x06, 0x016) https://github.com/olikraus/u8g2/blob/ec2559e8466dead8b13dd92cc17ac10e63dab6ac/csrc/u8x8_d_ssd1322.c#L280

right?

Is there any link to the display? We should give a different name to this constructor...

lucasgomesgs0 commented 4 months ago

I don’t know what the display spiderjuka bought, but I bought this one from the link:

https://a.aliexpress.com/_mLiYYnC

olikraus commented 4 months ago

Thanks, then I think I will call the constructor "ZJY". Like this:

U8G2_SSD1322_ZJY_256X64_...

spiderjuka commented 4 months ago

Hello,

It seems that I bought this same type (ZJY): https://www.ebay.pl/itm/404384193340.

olikraus - one comments: you wrote that second change need to be: "...Change this to U8X8_CAA(0xa0, 0x06, 0x016)..." - wrong. I changed second parameter of init seq U8X8_CAA(0xa0, 0x06, 0x011) to 0x016. So new change should looks like: U8X8_CAA(0xa0, 0x016, 0x011).

olikraus commented 4 months ago

Ah, ok, then we have this:

Change x offset from 0x01c to 0x018: https://github.com/olikraus/u8g2/blob/ec2559e8466dead8b13dd92cc17ac10e63dab6ac/csrc/u8x8_d_ssd1322.c#L260

Change this line to U8X8_CAA(0xa0, 0x016, 0x011) https://github.com/olikraus/u8g2/blob/ec2559e8466dead8b13dd92cc17ac10e63dab6ac/csrc/u8x8_d_ssd1322.c#L280

right?

Thanks for the links!

spiderjuka commented 4 months ago

Yes - now is ok. Thank you for your job :)

olikraus commented 4 months ago

Thanks for reporting and testing :-)

spiderjuka commented 3 months ago

Olikraus - when your library will be updated about that issue? Does in new update will be new scrren called SSD1322 _ZJY?

Second question - can you support me to run my screen SSD1322_ZJY on ESPHome? ESPHome has another drivers for SSD1322 - there are also two problems like in your library: display is mirrored and blank bar - wrong offset of screen. First problem I solved in file "ssd1322_base.cpp" I was found similar line with remap fucntion: this->command(SSD1322_SETREMAP); this->data(0x14); this->data(0x11); after change adress 0x14 to 0x016 screen is OK (not mirror) but still there is blank bar - wrong offset of screen. I can't find relevant line in ESPHome driver to your seqence "default_x_offset". How can I add default_x_offset = / 0x018 to ESPHome driver? What default_x_offset does mean? Maybe is thee any other option to write that parameter in to memory of screen at ESPHome driver? SSD1322_esphome_drivers.zip

kuzmanzs commented 3 months ago

Hi spiderjuka,

thanks for the suggestion. It is almost perfect. I have only thing, if you check the text after it there is a thin line. Do you have it as well?

Olikraus big thanks for the lib. ssd1322_new

spiderjuka commented 3 months ago

Hello,

Try comment line 379 at file u8x8_d_ssd1322.c: U8X8_CAA(0xb4, 0xa0, 0x005|0x0fd), / Display Enhancement A /

Please let me know if it support you?

lucasgomesgs0 commented 3 months ago

Hi spiderjuka,

thanks for the suggestion. It is almost perfect. I have only thing, if you check the text after it there is a thin line. Do you have it as well?

Olikraus big thanks for the lib. ssd1322_new

Try other font, this fix that problem for me

spiderjuka commented 3 months ago

After comment line U8X8_CAA(0xb4, 0xa0, 0x005|0x0fd), / Display Enhancement A / text should be without line. I tried it but for ESPHome driver - there are also exist "Display Enhancement A" parameter - after comment it text on screen is without line.

kuzmanzs commented 3 months ago

yes, it helps. Thank you!

olikraus commented 3 months ago

Olikraus - when your library will be updated about that issue?

Good question. I don't have time to work on u8g2 at the moment

Does in new update will be new scrren called SSD1322 _ZJY?

I could name the new cosntructor like this...

Additional Referene: https://github.com/olikraus/u8g2/issues/2393

SirusPTB commented 1 week ago

You guys are the best thank you so much for the fixes.