NHD-C0220BiZ-FS(RGB)-FBW-3VM set up help request (newbie)
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.
-
Below is some example code for that display with the Arduino Mega:
#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.0 -
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.0 -
The display will not work without the capacitors on those lines.
0 -
Hi again,
I'm currently running this code which essentially is the same as the demo codedisplay.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.0 -
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?
0
Please sign in to leave a comment.
Comments
5 comments