Aliexpress OLED 16x02 not working/WS0012

Thanks Bill !
Sorry - I have only this datasheet in my Post #11
An Inquerry at WINSTAR result this Demo Code:

REX001602_4bit_6800.zip (2.2 KB)

And a Notice/Remark:

https://www.winstar.com.tw/de/technology/oled.html

Mayby is this helpful for you.
I will answer your mail separately as soon as possible.
These OLEDs are mutch sold on Aliexpress - I think many people
would be happy and be excited about a library for the Arduino.
See you soon,

many Greetings

maik

Just out of curiosity have you tried using the hd44780_pinIO class in the hd44780 library and increased the instruction timing using setExecTimes()
Perhaps set them to something quite long just to see if it is timing issue.
i.e. add
lcd.setExectimes(9000, 8000); // 8ms for clear/home and 8ms for all others

Just before the lcd.begin()

From looking at an AdaFruit library that was for a Winstar OLED display they bumped the instruction significant during the initialization.
Over the years I have read others say that the instruction timing for some of the OLED displays is slower than the typical hd44780 display.
I would not recommend using the Adafruit library since that same library has MANY issues in it so I wouldn't use it.
The biggest issue is that they poll BUSY after initialization but they incorrectly poll the bus. They create a short on the data bus pins while they are polling and are needlessly bumping the E signal when polling for BUSY.
This could damage the LCD or the Arduino.

--- bill

I have the LCDs in hand.
Will start looking at getting them to work with the hd44780 library.
--- bill

LCDs?

Ok, OK, my bad. They are OLED displays. i.e. the devices that @maik_s showed previously.
But they work like hd44780 LCDs... :wink:

So far I have the larger one up and running with the library supplied by joy-it
It is a pretty wimpy library and the API is not very compatible with the LiquidCrystal API or LCD API 1.0

joy-it product/datasheets for that larger display are here:

And their demo library is here:

The device comes strapped for 6800 mode but can strapped for 8080 mode or SPI.

I'm just about to get started on getting the hd44780 library to work with it.

OK, this is going to take some time.
The COM-OLED16X2 uses the IST0010 chip.
It is not fully compatible with the hd44780 instruction set.
They screwed up some things.
Things I've found so far:
They totally screwed up the Clear Display instruction.
It is not setting the DDRAM address counter to zero.
Obviously they didn't even test this.
This means after a clear it picks up writing right were it was before the clear.
Also, sometimes it screws up its shift offset on the display.
The only way to reset the shift offset back to normal is to use the Return Home instruction
At least they got Return Home instruction correct.

Also, the chipset does not appear to follow its documented instruction set with respect to initialization or at least has issues when doing a proper hd44780 initialization sequence. All the needed instructions are claimed to be supported.
There are some issues. I am assuming they never really tested it with the proper hd44780 initialization sequence since their example initialization sequences would only work from a power up and not a warm start.
It also looks like they found out they have issues setting the font since you can't use alternate fonts in 4 bit mode since they screwed up the Function Set instruction by trying to extend it to use 2 reserved bits that must always be zero to have a reliable initialization sequence.
I have seen other chips makes this mistake.
Not sure what they are doing but the chip has initialization issues when using the normal & robust hd44780 initialization sequence.

I think I remember looking at this chipset a few years ago and at the time opted not to deal with it.

It will take some time to figure out what works, what doesn't and what needs to be done to work around the issues. And since the issues are in the hd44780 layer/commands this can't just be dropped in the top level hd44780 class since any goofy workarounds for this chipset are obviously chip set specific.
It will require its own i/o class that will have to snoop for certain instructions and alter them on the fly.
What a mess.

--- bill

Wow, I'm really pulling my hair out on this. So far none of the recommended initialization procedures in the datasheet truly work. Yes it works from a power cycle but they are not reliable from a warmstart once the device is already operating in 4 bit mode.
That and I can't fully figure out what is going with the Clear Display and Return Home instructions. They just don't work correctly and the Home doesn't always work the same way.

Definitely not impressed with the IST0010 chipset.

--- bill

This !@#$!#$#!@$ forum software!!!!!!!!!!!!!!!!!!!!!!!!
You can't post more than 3 posts without someone doing a replay.
There is no reason to do this type of nonsense.


Here is my next update:
So the weirdness continues.
I'm currently testing on an UNO platform. (16Mhz AVR)
There is some sort of Arduino Core library or compiler issue that is causing problems.
I need to do some disassembly to see what is happening but here is the issue:

Background:
The IST code library seems to be able to reliably initialize the display.
It uses a different set of instructions than what the data sheet recommends.
I changed the IST library code to use a delay rather than poll busy to get it closer to the hd44780 library code.

Now for the REALLY strange part:

If delayMicroseconds() is the last thing in a function before a return,
then the initialization fails. If I insert some dummy code after delayMicroseconds() then it works.
If I switch to using delay() it works but the timing is slower than needed.

Even stranger, if I do this:

delayMicroseconds(50);
delay(1);

It works.
However, If I do this:

delay(1);
delayMicroseconds(50);

It fails.

I'm guessing that there is some kind of issue with the inline assembler in the delayMicroseconds() function that breaks the optimizer and somehow no delays are done including the delay() call.

This will take looking at the assembler to see what is happening.
Pretty crazy.

--- bill

Bill - did you get my last eMails and have you still reache something ?

@maik_s
I recently received an email about Vishay.
I just replied to that email.
Summary - it is complicated due to the chipsets not properly implementing the hd44780 instructions and not even implementing it the way their datasheet says it works (which is different from the true/real hd44780 datasheet)
I've been distracted by some personal stuff but will get back to this soon.
--- bill