Wintech 16X2 OLED can't use clear()
Moderators: adafruit_support_bill, adafruit

Wintech 16X2 OLED can't use clear()

by liudr on Thu Jan 03, 2013 2:29 am

I am referring to this product:

http://www.adafruit.com/products/823

I slightly modified the sample code to the following and it works as expected. But when I change the first line in loop() from home() to clear(), all hell broke loose. I sometimes don't see anything, sometimes see random characters, sometimes see the message on the wrong line.

The original sample code runs fine so I don't think connection was the problem, just including a clear() after initially printing something screws things up. Any thoughts? Thanks. I tried on both arduino 1.0 and 1.5

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_CharacterOLED.h>

// initialize the library with the numbers of the interface pins
Adafruit_CharacterOLED lcd(6, 7, 8, 9, 10, 11, 12);

void setup()
{
    // Print a message to the LCD.
  lcd.begin(16, 2);
}

void loop()
{
  lcd.home(); // Change this to lcd.home() it works but change it to lcd.clear() and the display screws up.
  lcd.print("hello OLED World");
  lcd.setCursor(0, 1);
  lcd.print(millis()/1000);
  delay(500);
 }
User avatar
liudr
 
Posts: 44
Joined: Sat Jan 15, 2011 11:08 pm
Location: USA

Re: Wintech 16X2 OLED can't use clear()

by adafruit_support_bill on Thu Jan 03, 2013 7:57 am

The Character OLED displays are a little quirky and not quite compatible with standard HD44780 LCD displays. The manufacturer's documentation is inaccurate and the library is our best attempt to reverse engineer the interface. The Clear and Scroll functions are not very reliable on this display.
User avatar
adafruit_support_bill
 
Posts: 30125
Joined: Sat Feb 07, 2009 10:11 am

Re: Wintech 16X2 OLED can't use clear()

by liudr on Thu Jan 03, 2013 12:42 pm

What is your suggestion in terms of clearing the screen then?
User avatar
liudr
 
Posts: 44
Joined: Sat Jan 15, 2011 11:08 pm
Location: USA

Re: Wintech 16X2 OLED can't use clear()

by adafruit_support_bill on Thu Jan 03, 2013 1:18 pm

Depends on the application. For dynamic text I usually selectively clear the characters I need to update by writing blanks to them. If you need a full-screen clear, you could try forcing a reset by calling "begin(16,2)" again.
User avatar
adafruit_support_bill
 
Posts: 30125
Joined: Sat Feb 07, 2009 10:11 am

Re: Wintech 16X2 OLED can't use clear()

by liudr on Thu Jan 03, 2013 1:21 pm

Well, I'm bummed. I tested out blink() and cursor() and they don't work, plus the lib says display() is flaky so there is really nothing I can do to port my phi_prompt library or support this OLED on my phi-panel LCD backpacks. Thanks for the half-baked library though. Wasted my whole night troubleshooting, trusting the lib was good, while I could have been properly informed and spent the time on something else.
User avatar
liudr
 
Posts: 44
Joined: Sat Jan 15, 2011 11:08 pm
Location: USA

Re: Wintech 16X2 OLED can't use clear()

by liudr on Thu Jan 03, 2013 2:08 pm

The display, on the other hand, is very good looking!!! So I sucked it up by disabling all the non-working functions and make my phi-panel LCD backpack work with the display. Using 80 spaces to clear the screen, instead of something that would do it in a blink of the eye, is a bit flickering. But my backpack has a display buffer so it only uses clear() once at initialization. No flickering. I will post some results after lunch. Thanks for the great product but the library needs more oven time!!!
User avatar
liudr
 
Posts: 44
Joined: Sat Jan 15, 2011 11:08 pm
Location: USA

Re: Wintech 16X2 OLED can't use clear()

by adafruit_support_bill on Thu Jan 03, 2013 3:52 pm

If I knew of a better library, I would point you to it. Unfortunately, the manufacturer's spec sheet s is quite useless and these displays have been a great source of frustration in the community.

NKC does claim to have a reliable library, but their test code is not very extensive:
http://forums.nkcelectronics.com/viewto ... ?f=8&t=928
User avatar
adafruit_support_bill
 
Posts: 30125
Joined: Sat Feb 07, 2009 10:11 am

Re: Wintech 16X2 OLED can't use clear()

by liudr on Thu Jan 03, 2013 4:12 pm

Thanks! BTW, here is the result after my workaround:

http://youtu.be/_pZlrcV4Bxg

So I commented out these functions and modified clear() to write 80 spaces and do a home(). It works as it should. With other software this would have flicker on the screen but with phi-panel's display buffer, it does not flicker.

Pictures:
Image

Also my blog post:
http://liudr.wordpress.com/2013/01/03/u ... phi-panel/

I can understand that without a spec sheet you are not able to do a lot more. But putting these limitations on the product page would be helpful. Also now you can say it is compatible with my LCD backpack but well, my backpack is not sold at adafruit.
User avatar
liudr
 
Posts: 44
Joined: Sat Jan 15, 2011 11:08 pm
Location: USA

Re: Wintech 16X2 OLED can't use clear()

by a4x4kiwi on Tue Jun 17, 2014 6:12 am

I am struggling with this at the moment as well.
http://avr.myluna.de/doku.php?id=en:lib-ws0010 suggests there is a problem with 4 bit mode.

I am using Raystar RS0010 OLEDs which should be compatible with Winstar WS0010 according to the vendor (Raystar).

Here is a link to the Raystar Datasheet which is the most comprehensive I have seen http://malfunction.faed.name/2014/06/raystar-rs0010-chipsete-data-sheet.html

This document provides a text description of each control bits function.

I hope it can provide some clues as to why the clear, blink, cursor, and display commands and and their opposites fail to work on the OLED library and assist to fix.


Mal
a4x4kiwi
 
Posts: 2
Joined: Tue May 25, 2010 12:14 pm

Re: Wintech 16X2 OLED can't use clear()

by adafruit_support_bill on Tue Jun 17, 2014 6:27 am

Thanks for the link!
User avatar
adafruit_support_bill
 
Posts: 30125
Joined: Sat Feb 07, 2009 10:11 am