Go Down

Topic: Midas OLED problem with custom chars (Read 71 times) previous topic - next topic

Crawford_Tillinghast

Hi all,

I've been using the NewLiquidCrystal_I2C library by fmalpartida with a Winstar 20*4 OLED using a PCF8574T backpack with no real issues.  That uses the WS0010 controller on board, I believe.

Now I have a 20*2 OLED module by Midas (uses the RS0010 controller) which seems to be acting strangely when it comes to using custom characters.  If I don't use them, everything seems fine, but i've noticed the following when I do:

1:  I can only create 4 custom characters with the MIdas display, or else it just doesn't display anything.  The Winstar display had no such issues, and I could create and display 8 custom characters quite happily.

2:  If I do manage to get some custom characters displayed, then custom character 0 always seems corrupted for some reason. 

It's almost like something's getting overwritten with junk in the controller's onboard memory when a certain number of custom characters are sent to it, but that's just a guess at this point.

The display: http://uk.rs-online.com/web/p/oled-displays/8143032/
The datasheet (such as it is...): http://docs-europe.electrocomponents.com/webdocs/12f8/0900766b812f85ad.pdf

Can anyone help?  I've searched the forums for similar issues but have not come across anything that seems relevant.  Is there an extra initialisation step the RS0010 needs over the WS0010, and if so, how do I go about it?

Here is the code i'm using to test with:

Code: [Select]


#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define DEFAULT_I2C 0x27


const  char heart0[8] PROGMEM = {
  B00000,
  B01010,
  B11111,
  B11111,
  B01110,
  B00100,
  B00000,
  B00000
 };

const  char heart1[8] PROGMEM = {
  B00000,
  B01010,
  B10101,
  B10001,
  B01010,
  B00100,
  B00000,
  B00000
 };

const  char bankA[8] PROGMEM = {
  B00000,
  B11111,
  B10001,
  B10101,
  B10001,
  B10101,
  B11111,
  B00000
};

const  char bankB[8] PROGMEM = {
  B00000,
  B11111,
  B10111,
  B10001,
  B10101,
  B10001,
  B11111,
  B00000
};


const char note0[8] PROGMEM = {
  B00010,
  B00010,
  B00010,
  B00010,
  B01110,
  B11110,
  B01100,
  B00000,
 
  };

const char cross0[8] PROGMEM = {
  B00000,
  B01110,
  B10101,
  B11111,
  B01010,
  B10001,
  B01010,
  B00000,
};

const char tick1[8] PROGMEM = {
  B11111,
  B11110,
  B11101,
  B01011,
  B10111,
  B11111,
  B00000,
  B00000,
};

const char cross1[8] PROGMEM = {
  B00000,
  B01110,
  B10101,
  B11111,
  B01010,
  B10001,
  B10001,
  B00000,
};

const char* const customCharPtr[8] PROGMEM = {heart0, heart1, bankA, bankB, cross0, cross1, note0, tick1};



LiquidCrystal_I2C lcd(DEFAULT_I2C, 2, 1, 0, 4, 5, 6, 7);

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);

  lcd.begin(20, 2);
 for(int i = 0; i < 4; i++)
 {
    lcd.createChar(i, (char*) pgm_read_word(&(customCharPtr[i])));
 //    delay(150);
 }


  lcd.home();
  lcd.setCursor(4, 0);
  lcd.print(F("OLED I2C"));

  lcd.write((byte) 1);
  lcd.write((byte) 0);
  lcd.write((byte) 2);
  lcd.write((byte) 3);
 
  lcd.setCursor(5, 1);
  lcd.print(F("[Test] "));

//  lcd.write((byte) 4);
//  lcd.write((byte) 5);
//  lcd.write((byte) 6);
 // lcd.write((byte) 7);
}

void loop() {
  // put your main code here, to run repeatedly:

}


Many thanks for your time, hope someone can see where i'm going wrong.


Crawford_Tillinghast

Found a workaround for this problem - it seems that custom characters where the first byte is a zero can be a problem when put in certain locations, but not in others. So if I rearrange the locations of some of the custom characters they seem to display as expected with this Midas OLED, where everything just worked with the Winstar OLED.  Strange...

Hope this helps someone else out if anyone is experiencing similar weird issues (such as corruption or display hangs) with custom characters on Midas OLEDs.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy