Author Topic: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)  (Read 377 times)

duwaar

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« on: April 08, 2019, 11:44:03 AM »
I am trying to control the NHD-C12832A1Z-NSW-BBW-3V3 with an Arduino Uno, but after several days of work I still can't get it to do anything. I am on the verge of buying a different LCD. I have tried several of the pieces of example code (after correcting the errors), but I have not been able to get any of them to work. Any help would be greatly appreciated.

Here is the code I'm working on currently:
/*
 * myLCD.ino
 */
#include "font.h"
#include "sample.h"

int i;

// Define Control Pins
const int cs1 = 6;
const int res = 10;
const int a0  = 11;
const int si  = 12;
const int sck = 13;



void lcd_comm_out(uint8_t c){
    digitalWrite(a0, 0); // set A0 high (Command)
    digitalWrite(cs1, 0);

    for (i=0; i<8; i++)
    {
        c <<= 1;
        digitalWrite(sck, 0);
        digitalWrite(si,  c);
        delay(2);
        digitalWrite(sck, 1);
        delay(2);
    }

    digitalWrite(cs1, 1);
}

void lcd_data_out(uint8_t c){
    digitalWrite(a0, 1); // set A0 high (Data)
    digitalWrite(cs1, 0);

    for (i=0; i<8; i++)
    {
        c <<= 1;
        digitalWrite(sck, 0);
        digitalWrite(si,  c);
        delay(2);
        digitalWrite(sck, 1);
        delay(2);
    }

    digitalWrite(cs1, 1);
}

void lcd_draw_char(unsigned char column, unsigned char page, unsigned char letter){
    unsigned char count, msb, lsb;
   
    lsb = ((column)&(0x0F));
    msb = ((column>>4)&(0x0F));
    msb |= 0x10;
    page |= 0xB0;
   
    lcd_comm_out(msb);
    lcd_comm_out(lsb);
    lcd_comm_out(page);

    for (count=0;count<5;count++)//each character is 5px wide - 'count'
    {
        lcd_data_out(Ascii_1[letter][count]);
    }
}

void lcd_draw_string(uint8_t column, uint8_t page, char *string){
    uint8_t i = 0;
    while(string[0] != 0){
        lcd_draw_char(column+(5*i), page, (string[0]-32));
        string++;
        i++;
    }
}

void dispPic(const char *lcd_string)
{
   unsigned int i,j;
   unsigned char page = 0xB0;      //Page Address + 0xB0
   lcd_comm_out(0xAE);                 //Display OFF
   lcd_comm_out(0x40);               //Display start address + 0x40
   for(i=0;i<4;i++){            //32pixel display / 8 pixels per page = 4 pages
      lcd_comm_out(page);            //send page address
      lcd_comm_out(0x10);            //column address upper 4 bits + 0x10
      lcd_comm_out(0x00);            //column address lower 4 bits + 0x00
      for(j=0;j<128;j++){         //128 columns wide
         lcd_data_out(*lcd_string);      //send picture data
         lcd_string++;         //point to next picture data
         }
      page++;               //after 128 columns, go to next page
         }
   lcd_comm_out(0xAF);               //Display ON
}


void setup(){
    // Set up the output pins
    pinMode(cs1, OUTPUT);
    pinMode(res, OUTPUT);
    pinMode(a0,  OUTPUT);
    pinMode(si,  OUTPUT);
    pinMode(sck, OUTPUT);

    digitalWrite(cs1, 0);
    digitalWrite(res, 0); // Reset
    digitalWrite(a0,  0);
    digitalWrite(si,  0);
    digitalWrite(sck, 0);

    delay(10);

    digitalWrite(res, 1); // Now, stop resetting.

    delay(10);

    // Initialize LCD
    lcd_comm_out(0xA2); // added 1/9 bias
    lcd_comm_out(0xA0); // ADC segment driver direction (A0 = normal)
    lcd_comm_out(0xC0); // COM output scan direction normal
    lcd_comm_out(0x25); // resistor ratio
    lcd_comm_out(0x81); // Set contrast register
    lcd_comm_out(0x15); // Set contrast value
    lcd_comm_out(0x2F); // operating mode
    lcd_comm_out(0x40); // start line set
    lcd_comm_out(0xAE); // display on

    delay(10);
}

void loop(){
    lcd_draw_string(0,0, "Hello World");
    delay(1000);

    lcd_draw_string(0,7, "Elegant Circuits");
    delay(1000);

    dispPic(logo);
    delay(1000);

    dispPic(graphic1);
   delay(1000);

   dispPic(graphic2);
   delay(1000);
}

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #1 on: April 08, 2019, 12:06:32 PM »
Hi Duwaar,

I'm sorry to hear you are experiencing issues with this display.

For your convenience, I've linked some sample code that's been tested and verified to work for the NHD-C12832A1Z display. Please account for the difference in pin setups and see if this program works for you.

Code: [Select]
/*
 * Copyright (c) 2018, Newhaven Display International
 *
 * This code is provided as an example only and is not guaranteed by Newhaven Display.
 * Newhaven Display accepts no responsibility for any issues resulting from its use.
 * The developer of the final application incorporating any parts of this
 * sample code is responsible for ensuring its safe and correct operation
 * and for any consequences resulting from its use.
 *
 * Program written for C12832A1Z Chip-On-Glass Display.
 * Code written for Arduino Uno.
 * Code written for Serial Interface.
 * User Vertical Orientation when converting BMP to hex code to display custom image using LCD assistant. 
*/

/****************************************************
*               Pinout on Arduino Uno               *
*****************************************************/

#define RES 8   //Reset signal
#define CS  9   //Chip select signal
#define RS 10   //Register select signal
#define SC 11   //Serial clock signal
#define SI 12   //Serial data signal

/****************************************************
*               Hex Table for Image Pic             *
*****************************************************/

unsigned char NHD_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, 0x10, 0x38, 0x38, 0x10, 0x90, 0x50,
0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0xF0, 0x30, 0xC0, 0x00, 0xF0, 0x00, 0x00, 0xF0, 0x50,
0x50, 0x50, 0x00, 0x00, 0x10, 0xF0, 0x00, 0xE0, 0x10, 0xC0, 0x80, 0x70, 0x00, 0x00, 0x00, 0xF0,
0x40, 0x40, 0xF0, 0x00, 0x00, 0x80, 0xE0, 0x90, 0xE0, 0x80, 0x00, 0x00, 0x30, 0xE0, 0x00, 0xE0,
0x30, 0x00, 0x00, 0xF0, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0xF0, 0x30, 0xC0, 0xF0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00,
0x70, 0x50, 0x50, 0x50, 0xD0, 0x00, 0x00, 0x00, 0xF0, 0x50, 0x50, 0x70, 0x00, 0x00, 0x00, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0x90, 0xE0, 0x80, 0x00, 0x00, 0x30, 0xE0, 0x60, 0x30, 0x00,
0x00, 0x70, 0x70, 0x60, 0x20, 0x22, 0x27, 0x27, 0x22, 0x22, 0x22, 0x12, 0x11, 0x09, 0x04, 0x02,
0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 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, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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
};

/****************************************************
*                 Function Commands                  *
*****************************************************/

void data_write(unsigned char d) //Data Output Serial Interface
{
unsigned int n;
digitalWrite(CS, LOW);
digitalWrite(RS, HIGH);
for(n=0;n<8;n++){
if((d&0x80)==0x80)
digitalWrite(SI, HIGH);
else
digitalWrite(SI, LOW);
while(0);
d=(d<<1);
digitalWrite(SC, LOW);
while(0);
digitalWrite(SC, HIGH);
while(0);
digitalWrite(SC, LOW);
}
digitalWrite(CS, HIGH);
}


void comm_write(unsigned char d) //Command Output Serial Interface
{
unsigned int n;
digitalWrite(CS, LOW);
digitalWrite(RS, LOW);
for(n=0;n<8;n++){
if((d&0x80)==0x80)
digitalWrite(SI, HIGH);
else
digitalWrite(SI, LOW);
while(0);
d=(d<<1);
digitalWrite(SC, LOW);
while(0);
digitalWrite(SC, HIGH);
while(0);
digitalWrite(SC, LOW);
}
digitalWrite(CS, HIGH);
}


void DispPic(unsigned char *lcd_string)
{
  unsigned int i,j;
  unsigned char page = 0xB0;
  comm_write(0xAE);          //Display OFF
  comm_write(0x40);         //Display start address + 0x40
  for(i=0;i<4;i++){       //32pixel display / 8 pixels per page = 4 pages
    comm_write(page);       //send page address
    comm_write(0x10);       //column address upper 4 bits + 0x10
    comm_write(0x00);       //column address lower 4 bits + 0x00
    for(j=0;j<128;j++){     //128 columns wide
      data_write(*lcd_string);    //send picture data
      lcd_string++;
      }
      page++;         //after 128 columns, go to next page
      }
  comm_write(0xAF);   
 
}

void ClearLCD(unsigned char *lcd_string)
{
    unsigned int i,j;
  unsigned char page = 0xB0;
  comm_write(0xAE);          //Display OFF
  comm_write(0x40);         //Display start address + 0x40
  for(i=0;i<4;i++){       //32pixel display / 8 pixels per page = 4 pages
    comm_write(page);       //send page address
    comm_write(0x10);       //column address upper 4 bits + 0x10
    comm_write(0x00);       //column address lower 4 bits + 0x00
    for(j=0;j<128;j++){     //128 columns wide
      data_write(0x00);    //send picture data
      lcd_string++;
      }
      page++;         //after 128 columns, go to next page
      }
  comm_write(0xAF);   
}

/****************************************************
*           Initialization For controller           *
*****************************************************/

void init_LCD()  {
comm_write(0xA0);   // ADC select
comm_write(0xAE);   // Display OFF
comm_write(0xC8);   // COM direction scan
comm_write(0xA2);   // LCD bias set
comm_write(0x2F);   // Power Control set
comm_write(0x21);   // Resistor Ratio Set
comm_write(0x81);   // Electronic Volume Command (set contrast) Double Btye: 1 of 2
comm_write(0x20);   // Electronic Volume value (contrast value) Double Byte: 2 of 2
comm_write(0xAF);   // Display ON
}

/*****************************************************
*           Setup Function, to run once              *
*****************************************************/

void setup() {
  DDRD = 0xFF;          // configure PORTD as output
  pinMode(RES, OUTPUT); // configure RES as output
  pinMode(CS, OUTPUT);  // configure CS as output
  pinMode(RS, OUTPUT);  // configure RS as output
  pinMode(SC, OUTPUT);  // configure SC as output
  pinMode(SI, OUTPUT);  // configure SI as output
  digitalWrite(RES, LOW);           
  delay(100);                     
  digitalWrite(RES, HIGH);           
  delay(100);
  init_LCD();     
}

/*****************************************************
*           Loop Function, to run repeatedly         *
*****************************************************/

void loop() {
delay(10);   
while(1)
{
    DispPic(NHD_Logo);
    delay(500);
    ClearLCD(NHD_Logo);
    delay(500);

    DispPic(FMRadio);
    delay(500);
    ClearLCD(FMRadio);
    delay(500);
}
}

If this program doesn't work for you, may you please share your measured voltage readings across Pins 1-5 (V0-V4) and Pin 10 (Vout)? Can you also share your capacitor values being used in your setup?

duwaar

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #2 on: April 09, 2019, 08:36:17 AM »
It looks like maybe something is happening, but whatever the display is doing is so faint that I can't make it out.
The voltage between pin 1 and pin 5 is around 150mV at first, but it falls as long as I am measuring it.
The voltage between ground and pin 10 is consistently 2.96V.
All the capacitors I'm using are 1uF.

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #3 on: April 09, 2019, 10:54:07 AM »
Hi Duwaar,

I should have clarified; I meant to ask if you can check the voltages across Pin 1-5 with respect to GND. Sorry about the confusion.
Also, I've tested and verified this program to work here at the lab recently, but your Vout reading of 2.96V is pretty low, and is not enough for the displays proper contrast.

Can you verify if your hardware connections are secure and proper per the displays schematic?
If you'd like, you may also provide us your schematic for review.

Also, please note that the contrast is software adjustable, and can be done using the 2nd byte for "Electronic Volume value" in the initialization function. Please try increasing that value wihile keeping it within its constraints (0x00 - 0x3F) and see if the display behaves differently. You may also moniter Pin 10 with respect to GND when doing so, for a better indication of any change.

Code: [Select]
/****************************************************
*           Initialization For controller           *
*****************************************************/

void init_LCD()  {
comm_write(0xA0);   // ADC select
comm_write(0xAE);   // Display OFF
comm_write(0xC8);   // COM direction scan
comm_write(0xA2);   // LCD bias set
comm_write(0x2F);   // Power Control set
comm_write(0x21);   // Resistor Ratio Set
comm_write(0x81);   // Electronic Volume Command (set contrast) Double Btye: 1 of 2
comm_write(0x20);   // Electronic Volume value (contrast value) Double Byte: 2 of 2
comm_write(0xAF);   // Display ON
}

Display Datasheet: http://www.newhavendisplay.com/specs/NHD-C12832A1Z-NSW-BBW-3V3.pdf

duwaar

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #4 on: April 12, 2019, 10:41:34 AM »
Ok, here are the voltages on pins 1 through 5:
p1:   15 mV
p2: 163 mV
p3: 140 mV
p4:   27 mV
p5: 150 mV

I have checked and double-checked the wiring. I have the thing wired up exactly according to the diagram on the datasheet.

I have messed with the software-defined contrast setting, but didn't get any visible change.

I have also read the datasheet, but it is confusing. In the section describing the control protocol, not only are the register select pin (A0) and the data bits specified, but there is also mention of two extra pins, /RD and /WR, which are not on my device. Also, on page 5 of the datasheet, on the "electrical characteristics" table, there is a parameter called "Supply for LCD (contrast)" which is 6 V. What is that? I don't see 6 V anywhere else on the datasheet.

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #5 on: April 15, 2019, 11:17:28 AM »
Hi Duwaar,

Please note the ST7565 controller is capable of supporting both parallel and serial interface, and the /RD & /WR pins are used for 8080 parallel mode interface. However, our display only has the serial interface pins brought out to the user from the controller, so this display can only operate in serial mode. As a result, you may disregard the /RD & /WR pins for your application.

The "supply for LCD (contrast)" is the Voltage value needed for the LCD glass itself, and the 6V is generated by the voltage-booster circuit. However based on your Pins1-5 and Pin 10 measurements, these are low readings and indicate the display is not receiving its necessary voltages.

Do you have more than 1 display available to test? If so, have you seen the same results from those as well?
Do you also have more testers available to test these displays?

duwaar

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #6 on: April 15, 2019, 03:08:28 PM »
I only have one display and one Arduino. There are several multimeters in the lab here, but I doubt that is the problem.

I am powering the display from the Arduino's 3v3 pin, but it looks like the little regulator behind that can only put out 50 mA max. Should that be enough?
I am powering the backlight with that same 3v3 pin. Could I possibly power the backlight from the 5v pin instead?

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 40
  • Karma: 0
    • View Profile
Re: Can't figure this thing out (NHD-C12832A1Z-NSW-BBW-3V3)
« Reply #7 on: April 23, 2019, 09:53:08 AM »
Hi Duwaar,

Yes, the max current output from the regulator should be sufficient, as this display requires a max of 1mA to operate.
The backlights shouldn't be powered with the 5V pin either, as its rated for 3.3V operation only.

Since you are still seeing low voltages across Vout and V1-V5, this indicates the voltage-booster circuit isn't properly activating.
Can you verify that you have changed the pin locations from your setup on the Arduino to match with the code I've provided? 
Code: [Select]
/****************************************************
*               Pinout on Arduino Uno               *
*****************************************************/

#define RES 8   //Reset signal
#define CS  9   //Chip select signal
#define RS 10   //Register select signal
#define SC 11   //Serial clock signal
#define SI 12   //Serial data signal

Can you also clarify if you are using electrolytic capacitors, and provide an image of your setup if so? Or are you utilizing non-polarized capacitors?

Perhaps you may also be interested our NHD-PCB12832A1Z; a PCB specifically designed with the necessary capacitors and a current-limiting resistor on-board for this display. This would be an ideal part to use simultaneously for optimal prototyping.
PCB Overview: https://www.newhavendisplay.com/nhdpcb12832a1z-p-3569.html

 

NHD-C12832A1Z-FS(RGB)-FBW-3V Backlight Color Control

Started by dglassBoard Graphic LCDs

Replies: 3
Views: 6679
Last post November 18, 2014, 08:42:52 AM
by Michael_L
NHD-C12832A1Z-FSW-FBW-3V3 1.5mm header

Started by jaredmnyBoard Graphic LCDs

Replies: 2
Views: 4794
Last post April 05, 2016, 02:22:31 PM
by bkulpa
SPI connection to NHD-C12832A1Z-FSR-FBW-3V3

Started by raspdroidBoard Graphic LCDs

Replies: 1
Views: 4850
Last post January 29, 2016, 09:29:52 AM
by Saurabh_B