Using Libraries/writing code for NHD-C0220BiZ-FS(RGB)-FBW-3VM on Arduino Uno

Hello,

This is my first time using an i2C character display - I have found several libraries that support it but haven't been able to get any of the examples to work.

The common thing I see in all of them is they never define the transmission pin, or a reset pin or anything (just talking about the examples - I have a hard time deciphering the library code in notepad).

So my main question is: is it necessary to define a pin for the transmission data or is that somehow included in the library?

Display being used:

I have it wired up as in the diagram on page 4.

Library being used:

https://bitbucket.org/fmalpartida/st7036-display-driver/downloads/

Code (modified from the example):

#include <Arduino.h>
#include "ST7036.h"
#include "LCD_C0220BiZ.h"
#include <Wire.h>

//LCD_C0220BIZ lcd = LCD_C0220BIZ ( );
ST7036 lcd = ST7036 ( 2, 20, 0x78 );

const int resetPin = 8;

void setup ()
{
  pinMode(resetPin, OUTPUT);
  digitalWrite(resetPin, LOW);
   Serial.begin ( 57600 );
   lcd.init ();
   lcd.setContrast(10);
}

void loop ()
{
  //digitalWrite(resetPin, HIGH);
  lcd.clear ();
  lcd.setCursor ( 0, 0 );
  lcd.print ("abcdefg");
  lcd.write ("abcdefg");
  Wire.write ("abcdefg");
  delay (100);
}

I have lcd.print, lcd.write, and Wire.write just to see if different things were going to work. I also tried it without the reset pin, and with the commented out [resetPin, High] too.

So, what am I missing?

Thanks

The Wire/TWI/I2C interface has a bidirectional data pin (SDA) and a clock pin (SCL). Each device connects to both of those pins and each has an address. Look at the documentation for the Wire library to see how to wire your device:

It looks like the ST7036 constructor takes three arguments. You have to look at the examples or read the documentation to find out what each is. The 0x78 is the address of the LCD. There should probably be a pin number for the RS pin which selects between Registers and RAM. The library will need to use that pin. Maybe that's what the '2' represents. I don't know what the '20' represents. Do you?

If everything is wired correctly you should be able to use lcd.print() to display text on the LCD.

I know the "20" is the number of characters that can be displayed horizontally. I think the "2" is the number of lines / rows that can be displayed.

Reading the reference page you linked says to connect to the SCL and SDA pins, which is what I did, I just didn't know if I had to tell the program that's what I had done.

Checking the voltages to see about the wiring, it looks like everything is good. I'm even getting signal voltages from the SCL and SDA pins, which may be good, I'm not sure.

I'll look for a specific reset pin called out. Still not sure how to read the library code in notepad though.

Realized I needed to set the reset pin [HIGH] in the setup to get it to work. Feel kind of silly. Final functional code is below:

#include <Arduino.h>
#include "ST7036.h"
#include "LCD_C0220BiZ.h"
#include <Wire.h>

//LCD_C0220BIZ lcd = LCD_C0220BIZ ( );
ST7036 lcd = ST7036 ( 2, 20, 0x78 );

const int resetPin = 8;

void setup ()
{
  pinMode(resetPin, OUTPUT);
  digitalWrite(resetPin, LOW);
  digitalWrite(resetPin, HIGH);
  Serial.begin ( 57600 );
  lcd.init ();
  lcd.setContrast(10);
}

void loop ()
{
  lcd.clear ();
  lcd.setCursor ( 0, 0 );
  lcd.print ("abcdefg");
  delay (1000);
  lcd.print("hijklmnop");
  delay(1000);
  lcd.setCursor ( 1, 0 );
  lcd.print("qrs");
  delay(1000);
  lcd.print("tuv");
  delay(1000);
  lcd.print("wx");
  delay(1000);
  lcd.print("yz");
  delay(1000);
}

Hope it might help someone down the line.

Thanks