Author Topic: NHD-12864AZ-FL-YBW goes blank after a few seconds  (Read 671 times)

cleo

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
NHD-12864AZ-FL-YBW goes blank after a few seconds
« on: December 12, 2018, 09:18:39 AM »
I am trying to replace a AG-12864A LCD with a NHD-12864AZ-FL_YBW but I can't get it to work using the same code. The NHD-12864 displays messages for a few seconds on the whole length of the display, after that the right side goes blank and I can see only the left side displaying messages and in short time the whole display goes blank. Do you have any suggestion regarding this issue ?

Thanks,

Cleo

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 50
  • Karma: 0
    • View Profile
Re: NHD-12864AZ-FL-YBW goes blank after a few seconds
« Reply #1 on: December 20, 2018, 10:02:17 AM »
Hello there!

I have reviewed the controller datasheets for both displays, and they are extremely similar in their commands, timing characteristics, DC electrical characteristics, pin connections, etc. which leads me to believe it is not a controller compatibility issue.

I have provided a sample code for you below, and have confirmed that it works for the model you are using. I would advise to please try and run this code in the meantime with the schematic and pinout diagram you have. This program is meant to run using an Arduino Uno.

Code: [Select]
/*
 *  Program written for NHD-12864AZ Graphic Display
 *  Code written for Arduino Uno.
*/


/*************************************
    Image
**************************************/

const unsigned char A[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 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, 0x80, 0x80, 0xC0, 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0x7F, 0x1F, 0x0F, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0F,
0x1F, 0x7F, 0xFF, 0xFC, 0xF0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
0xE0, 0xE0, 0xE3, 0xF1, 0xF1, 0xF1, 0xF1, 0xF1, 0xF1, 0xF8, 0xF8, 0x78, 0x18, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x02, 0x00, 0x00, 0x01, 0x0F, 0x3F, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x0F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x03, 0x0F, 0x1F, 0x0F, 0x87, 0xC3, 0xE1, 0xF0, 0xF8, 0xFC, 0xFC, 0xF8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF0, 0xE0,
0x80, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x7F, 0x3F, 0x0F, 0x03, 0xC1, 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xE0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00,
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00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

/**************************************************************
 * DEFINITIONS
 ***************************************************************/

#define     CS1   12        //Chip Selection IC1 (1 0) Left side
#define     CS2   13         //Chip Selection IC2 (0 1) Right side
#define     RST   11          //Active Low Reset
#define     RW    9            //Low Write Signal
#define     RS    8             //Reg Select 1- Data 0-instruction
#define     E     10             //Operation Enable Falling Edge

/*******************************************
*       Basic Functions          *
*******************************************/

void  comleft(char c){
  PORTD = c;                           
  digitalWrite(CS1, HIGH);
  digitalWrite(RW , LOW );
  digitalWrite(RS , LOW );
  digitalWrite(E  , HIGH);
  delay(1);
  digitalWrite(E , LOW );
  digitalWrite(CS1, LOW);
}

void  comright(char c){
  PORTD = c;
  digitalWrite(CS2, HIGH);
  digitalWrite(RW , LOW );
  digitalWrite(RS , LOW );
  digitalWrite(E  , HIGH);
  delay(1);
  digitalWrite(E , LOW );
  digitalWrite(CS2, LOW); 
}

void  writeleft(char d){ 
  PORTD = d;
  digitalWrite(CS1, HIGH);
  digitalWrite(RW , LOW );
  digitalWrite(RS , HIGH);
  digitalWrite(E  , HIGH);
  delay(1);
  digitalWrite(E , LOW );
  digitalWrite(CS1, LOW);
}

void  writeright(char d){
  PORTD = d;
  digitalWrite(CS2, HIGH);
  digitalWrite(RW , LOW );
  digitalWrite(RS , HIGH);
  digitalWrite(E  , HIGH);
  delay(1);
  digitalWrite(E , LOW );
  digitalWrite(CS2, LOW);
}

/******************************************
*            Initialize                   *
******************************************/
void init1(){
  digitalWrite(RST, LOW);
  delay(1);
  digitalWrite(RST, HIGH);
  digitalWrite(E, LOW);
  digitalWrite(RS, LOW);
  digitalWrite(RW, LOW);
  digitalWrite(CS1, LOW);
  digitalWrite(CS2, LOW);
  comleft(0x3F);        //Display On
  comright(0x3F);       //Display On
}
/*****************************************
*               Display                  *
*****************************************/
//
void disp(const unsigned char *pic)
{
    int page;
    page = 0xB8;
 
  for(int page = 0xB8; page < ((0xB8) + 8) ; page++){
    comleft(page);
    comright(page);
    comleft(0x40);
    comright(0x40);
   
    for(int i = 0; i < 64; i++){
      writeleft(*pic);
      pic++;
    }
    for(int i = 0; i < 64; i++){
      writeright(*pic);
      pic++;
    }
  }
}

void setup() {

  DDRD = 0xFF;
  pinMode(CS1, OUTPUT);
  pinMode(CS2, OUTPUT);
  pinMode(RST, OUTPUT);
  pinMode(RW , OUTPUT);
  pinMode(RS , OUTPUT);
  pinMode(E  , OUTPUT);
  init1();

}

void loop() {
  disp(A);
  delay(3000);
}

If this code still doesn’t work, can you upload image(s) related to your pinout diagram and/or schematic for connecting to the NHD-12864AZ display?

Also, if you have multiple samples of our displays, are you experiencing the same issues when trying to connect with all of them?

 

Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 3
Views: 10601
Last post May 13, 2014, 12:04:36 AM
by SteveC
Blank display after several hours of working normally

Started by darrowBoard TFTs

Replies: 7
Views: 3670
Last post October 27, 2016, 01:54:07 PM
by Saurabh_B
Blank screen on Display NHD-C128128BZ-FSW-GBW

Started by firmware_digimedBoard Graphic LCDs

Replies: 3
Views: 890
Last post April 16, 2019, 04:28:57 PM
by Ted_M