Newhaven Products > Graphic LCDs

C12864WC - Capacitors

(1/1)

bradw:
Hi,

I purchased this COG LCD (http://www.newhavendisplay.com/nhdc12864wcfswfbw3v3-p-4048.html) and the FFC30 adapter board (http://www.newhavendisplay.com/nhdffc30-p-2477.html) with the hope that I can get it connected to a breadboard and arduino. This is my first time working with a COG LCD and I am not sure what capacitors I should use. Per the data sheet (http://www.newhavendisplay.com/specs/NHD-C12864WC-FSW-FBW-3V3.pdf), it states 1uF and 1uF-2.2uF caps are required. I did a search on digikey, jameco, radioshack and other sites and find hundreds of options matching this criteria. I ended up ordering these:

https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=81509
https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=33736

With everything hooked up, the display is not working right. It will flash 'hello world' and quickly dissolve away. I suspect the capacitors, as this is the piece I know the least about.

Could you verify these are ok to use or suggest what I should be using with this display?

Regards,
Brad

Michael_L:
Those caps should be ok.  If you have any others to try it wouldn't hurt to try them too, but if not just make sure the caps you do have are securely connected.  Also, please make sure you are initializing the display and writing to it correctly, as shown in my Arduino code below:


--- Code: ---//---------------------------------------------------------
/*
NHD_C12864WC_mega.ino
Program for writing to Newhaven Display 128x64 COG with ST7565R controller

(c)2014 Mike LaVine - Newhaven Display International, LLC.

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
*/
//---------------------------------------------------------

// The 5V regulator on the Arduino Mega board has been replaced with a 3.3V regulator to provide 3.3V logic

int CS = 30;  // CS signal connected to digital pin 30 of Arduino Mega
int RES = 31;  // RES signal connected to digital pin 31 of Arduino Mega
int AO = 32;  // A0 signal connected to digital pin 32 of Arduino Mega
int WR = 33;  // WR signal connected to digital pin 33 of Arduino Mega
int RD = 34;  // RD signal connected to digital pin 34 of Arduino Mega

// 8-bit parallel data bus connected to PORTA of the Arduino Mega

// C86 pin is tied LOW (8080 Mode)
// PS pin is tied HIGH (Parallel I/F)

unsigned char clr[] = {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

unsigned char logo[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x78, 0x78, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x68, 0x48, 0x00, 0x00, 0x00, 0x00,
0x00, 0x78, 0x50, 0x78, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x30, 0x18, 0x78, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x70, 0x70, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x78, 0x78, 0x40,
0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x48, 0x48, 0x78,
0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x60, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x70,
0x70, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0,
0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFC, 0xFC, 0x8C, 0x8C, 0x8C, 0xCC, 0xFC, 0x70, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00,
0x00, 0x00, 0xEC, 0xEC, 0xAC, 0xAC, 0xBC, 0xBC, 0x98, 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x30, 0x10,
0xB0, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0xFC, 0xFC, 0x04, 0x04, 0x04, 0x00, 0x00, 0x0C, 0x3C, 0xF8,
0x98, 0xD8, 0x78, 0x1C, 0x04, 0x00, 0x80, 0x80, 0xE0, 0x7C, 0x7C, 0xC0, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, 0x03, 0x11, 0x78, 0xFC, 0xFC, 0xFC, 0xFC, 0x78, 0x30,
0x30, 0x30, 0x30, 0x30, 0x31, 0x73, 0x63, 0xCE, 0xDE, 0x98, 0x30, 0x60, 0x60, 0x60, 0x60, 0x60,
0x60, 0x60, 0x01, 0xE1, 0xE1, 0x01, 0xC1, 0xE1, 0xE0, 0x00, 0x00, 0x00, 0x01, 0xC1, 0x60, 0x60,
0x60, 0x60, 0x61, 0x01, 0x01, 0x01, 0x01, 0xC1, 0xE1, 0xE0, 0x00, 0x00, 0xE1, 0xE1, 0xC1, 0x01,
0x01, 0x01, 0x00, 0xE0, 0xE0, 0x00, 0x01, 0x01, 0xE0, 0xE0, 0x00, 0x00, 0x60, 0xE0, 0xC0, 0x80,
0x81, 0xC1, 0xE0, 0x60, 0x20, 0x00, 0x01, 0x01, 0xC0, 0xE0, 0xE0, 0x81, 0x01, 0x00, 0x00, 0x00,
0x80, 0xC0, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x00, 0xC0, 0xE0, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1C, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x18, 0x18, 0x19, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
0x1B, 0x1B, 0x00, 0x1F, 0x1F, 0x07, 0x01, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x19,
0x1B, 0x1B, 0x02, 0x00, 0x00, 0x18, 0x1E, 0x07, 0x01, 0x03, 0x1E, 0x1F, 0x03, 0x01, 0x0F, 0x1F,
0x18, 0x00, 0x00, 0x1F, 0x1F, 0x03, 0x03, 0x03, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1E,
0x1C, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x0F, 0x03, 0x00, 0x03, 0x07, 0x1E, 0x18, 0x00, 0x01,
0x07, 0x0F, 0x1B, 0x1B, 0x1B, 0x1B, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x0E, 0x07, 0x01, 0x1F, 0x1F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void comm_out(char c)
{
  digitalWrite(CS, LOW);
  digitalWrite(AO, LOW);
  PORTA = c;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
  digitalWrite(CS, HIGH);
}

void data_out(unsigned char d)
{
  digitalWrite(CS, LOW);
  digitalWrite(AO, HIGH);
  PORTA = d;
  digitalWrite(WR, LOW);
  digitalWrite(WR, HIGH);
  digitalWrite(CS, HIGH);
}
void disp(unsigned char pic[])
{
unsigned int a, i;
unsigned char page = 0xB0;
        unsigned int x = 0;
       
for(i=0;i<8;i++)
{

comm_out(page);
comm_out(0x10);
comm_out(0x00);
for (a=0;a<128;a++)
{
data_out(pic[(a+x)]);
}
                 x+=128;
page++;
}
}
void setup(){
  pinMode(RES, OUTPUT);
  digitalWrite(RES, LOW);
  delay(120);
  digitalWrite(RES, HIGH);
  pinMode(CS, OUTPUT);
  pinMode(AO, OUTPUT);
  pinMode(WR, OUTPUT);
  pinMode(RD, OUTPUT);
  DDRA = 0xFF;
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(CS, HIGH);
 
  comm_out(0xA2);  //added 1/9 bias
  comm_out(0xA0);   //ADC segment driver direction (A0=Normal)
  comm_out(0xC8);   //added
  comm_out(0xC0);   //COM output scan direction (C0=Normal)
  comm_out(0x40);   //Operating Mode
  comm_out(0x25);   //resistor ratio
  comm_out(0x81);   //electronic volume mode set
  comm_out(0x2F);   //electronic volume registerset   //19
  comm_out(0x2F);   //power control set
  comm_out(0xAF);   //displayON/OFF - set to ON
}

void loop()
{
  disp(logo);
  delay(2000);
  disp(clr);
  delay(250);
}
--- End code ---

bradw:
Hi Michael,

Thanks for the response. I loaded your code onto my arduino mega, but no luck. Just get a blank screen. Seems something must be wired wrong. I was using uno before with serial interface. I wired to mega with parallel, as that looks like what your code is set up for. I read online that PORTA 0-7 on the mega is digital pin 22-29. I added the following code in the setup function the to set 8080/parallel, and tied them to lcd pin 29/30.

pinMode(4, INPUT);           // c86
digitalWrite(4, LOW);       //
pinMode(5, INPUT);           // ps
digitalWrite(5, HIGH);       //

I posted a couple pictures, maybe you can spot something from them.

https://drive.google.com/file/d/0B2wYgm2nW69rYlNMel84dDJDNnM/edit?usp=sharing
https://drive.google.com/file/d/0B2wYgm2nW69ram5ydXdxam1VclE/edit?usp=sharing
https://drive.google.com/file/d/0B2wYgm2nW69rQy1lTUJ3eWJiUVk/edit?usp=sharing
https://drive.google.com/file/d/0B2wYgm2nW69rSDdadHNfckNBSXM/edit?usp=sharing

Any help is appreciated. Would you happen to have sample code that uses serial (spi)?

Regards,
Brad

Michael_L:
Can I ask why you are making those pins inputs?  To write to them as you are trying to, you would need to use, for example, pinMode(4, OUTPUT).  Otherwise, you may simply tie them LOw and HIGH accordingly.

I don't have any code for SPI mode, however the initialization will be the same. If you would like example on writing to that controller with SPI, you may refer to the example code here:
http://www.newhavendisplay.com/app_notes/NHD-C12832A1Z.txt
It is for a different display but the SPI functions will be the same.

bradw:
Thank you for the other set of eyes! The display is now working.

Navigation

[0] Message Index

Go to full version