Author Topic: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)  (Read 3117 times)

lostminty

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Hi,

I've purchased a C0220BiZ display. I am connecting it to an mbed BLENano (Nordic chipset).  This device doesn't have many pins (It does have bluetooth which I plan to use to read terminal output soon).

Currently I have the following layout:

pin 1 (RST) : NC
pin 2 (SCL) : pin 9 of mbed
pin 3 (SDA) : pin 10 of mbed
pin 4 (VSS): Ground of mbed
pin 5 (VDD): VDD of mbed (3V3)
pin 6 (VOUT): 1uF 46(?)V electrolytic capacitor connected to VSS
pin 7 (C1+): 1 uF 46V electrolytic capacitor
pin 8 (C1-): 1 uF 46V electrolytic capacitor

On the spec sheet, which I admit I do not fully grasp, It looks like K-R/G/B and A go to ground. Also, VDD goes to ground?

I am not sure at all how to wire K-R/G/B and A. I've got a digitalPin off the mbed going through a 300 Ohm resistor to provide roughly 10mA? I'm unclear of what I'm doing at this point.

I'm going to double check I have SCL and SDA correctly orientated.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
« Reply #1 on: July 02, 2015, 08:06:04 AM »
Below is some example code for that display with the Arduino Mega:
Code: [Select]
#include <Wire.h>

int RES = 22;
int ASDA = 20;
int ASCL = 21;

unsigned char text1[]={"  Newhaven Display  "};
unsigned char text2[]={"____NHD-C0220BiZ____"};
unsigned char text3[]={"    May 28, 2015    "};
unsigned char text4[]={"   Michael LaVine   "};
unsigned char text5[]={"ACK TEST -- 11111111"};

const char slave2w = 0x3C;  //3E for CiZ (0x7C shifted over 1 bit)  //3C for BiZ (0x78 shifted over 1 bit)
const char comsend = 0x00;
const char datasend = 0x40;
const char line2 = 0xC0;

void show(unsigned char *text)
{
  int n, d;
  d=0x00;
  Wire.beginTransmission(slave2w);
  Wire.write(datasend);
  for(n=0;n<20;n++)
  {
    Wire.write(*text);
    ++text;
  }
 
  while(Wire.endTransmission());
}

void nextline(void)
{
  Wire.beginTransmission(slave2w);
  Wire.write(comsend);
  Wire.write(line2);
  while(Wire.endTransmission());
}

void cleardisplay(void)
{
  Wire.beginTransmission(slave2w);
  Wire.write(comsend);
  Wire.write(0x01);
  while(Wire.endTransmission());
}

void CiZ_init()
{
  Wire.beginTransmission(slave2w);
  Wire.write(comsend);
  Wire.write(0x39);
  delay(1);
  Wire.write(0x14);
  Wire.write(0x70);
  Wire.write(0x5E);
  Wire.write(0x6D);
  Wire.write(0x0C);
  Wire.write(0x01);
  Wire.write(0x06);
  while(Wire.endTransmission());
}

void setup()
{
  pinMode(RES, OUTPUT);
  pinMode(ASCL, OUTPUT);
  pinMode(ASDA, OUTPUT);
  digitalWrite(RES, HIGH);
  //delay(10);
  //digitalWrite(ASCL, LOW);
  //digitalWrite(ASDA, LOW);
  //delay(10);
  Wire.begin();
  delay(10);
  CiZ_init();
  delay(5);
}

void loop()
{
  show(text5);
  nextline();
  show(text2);
  delay(1500);
  cleardisplay();
  delay(2);

  show(text3);
  nextline();
  show(text4);
  delay(1500);
  cleardisplay();
  delay(2);
}

As for the backlight pins, K-R/G/B and A, these are the cathodes and anode, respectively.  The wiring diagram shows the anode A connected to power (upward facing triangle) and the cathodes are shown connected to ground (downwards facing triangles).

As for the I2C lines, you need pull-ups (typically 10kOhm) for them to work.

Lastly, if possible, try using non-electrolytic caps (not polarized) for pins 6-8.

lostminty

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
« Reply #2 on: July 02, 2015, 06:01:37 PM »
Thanks for the reply Michael.

I was using 5kOhm pull-up resistors so I'll try switching those.

The code I'm using is from an 'enhanced' lcd driver off the mbed website. It has a mode for the ST7036 chip. I'll use the example you've supplied to check the code fits with this.

The two capacitors, on VOUT and C1+/C1- , are they only needed for this 'vlcd' set up? will the display work correctly without them is what I mean.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
« Reply #3 on: July 06, 2015, 08:16:30 AM »
The display will not work without the capacitors on those lines.

lostminty

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
« Reply #4 on: July 06, 2015, 08:45:53 AM »
Hi again,

I'm currently running this code which essentially is the same as the demo code in the
Code: [Select]
display.frequency(300000); //in main method (display is an I2C object from mbeds API)
...


int lcd_init(int con){ //takes an int 0-63 for the 6bit contrast value. Adds these to the base values (0x70 and 0x5C) replaces 0x78 and 0x5E commands from the example
   
    int return_bit = 1;
    int address = 0x78<<1;
    int con1 = 0x70 + (con && 0xF);
    int con2 = 0x5C + (con && 0x30);
    display.start();
   
    return_bit=return_bit&display.write(address, (char*)0x00,4,false);
    return_bit=return_bit&display.write(address, (char*)0x38,4,false);
    wait_ms(10);
    return_bit=return_bit&display.write(address, (char*)0x39,4,false);
    wait_ms(10);
    return_bit=return_bit&display.write(address, (char*)0x14,4,false);
    return_bit=return_bit&display.write(address, (char*)con1,4,false);
    return_bit=return_bit&display.write(address, (char*)con2,4,false);
    return_bit=return_bit&display.write(address, (char*)0x6D,4,false);
    return_bit=return_bit&display.write(address, (char*)0x0C,4,false);
    return_bit=return_bit&display.write(address, (char*)0x01,4,false);
    return_bit=return_bit&display.write(address, (char*)0x06,4,false);
    display.stop();
   
    return return_bit;
}



void lcd_show(char* text){
    int n;
    display.start();
    int address = 0x78<<1;
    display.write(address,(char*)0x40,4,false);
    display.write(address,text,sizeof(text),false);
    display.stop();
}

The init always returns 1 so far. I have pretty normal voltages..

SCL  3.1V
SDA  3.1V
VSS 0V
VDD 3.1V
VOUT 2.8?V (this one I expected to change based on the int passed to the lcd_init method. It does not) (this is also a NP 100V 1uF cap)
C1+ 3.1V (might be the other way around, I replaced this with a non-polarised 100V 1uF cap)
C2- 0V

I remember seeing someone with an issue like this previously in the forum. Will be browsing it now.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
« Reply #5 on: July 07, 2015, 03:00:55 PM »
Those voltages you are seeing on those pins are what would be present if just applying power (VDD) and ground (VSS) to the display. You should have higher voltages on these pins if the display was initialized properly.  Have you verified your I2C communication?  Are you receiving ACKs from the display?  Have you successfully used your MCU's I2C bus with any other devices?

 

NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM capacitor on pin 7&8

Started by Ticoti0xFFBoard Character LCDs

Replies: 1
Views: 2804
Last post April 09, 2014, 10:17:30 AM
by Michael_L
NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM Potting

Started by SebKisterBoard Character LCDs

Replies: 1
Views: 1829
Last post June 22, 2016, 04:51:17 PM
by Saurabh_B
Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 4
Views: 4581
Last post Today at 01:47:42 AM
by tolikkk
NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM - Cable for LED Backlights

Started by wadehBoard Character LCDs

Replies: 2
Views: 864
Last post December 02, 2016, 06:02:27 PM
by wadeh
Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD

Started by SteveCBoard Character LCDs

Replies: 2
Views: 3022
Last post July 31, 2014, 08:44:29 PM
by SteveC