Author Topic: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue  (Read 7438 times)

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« on: March 04, 2015, 04:55:54 PM »
Hey,

For the 8080 Series running 3.3V, does the Enable(/RD) Pin need to be toggled high -> low? Right now I have it tied to ground, but whenever I update my code, the text starts printing from right to left and the text is mirrored. But when I reset the power, the text prints correctly. However, the first 4 text doesn't appear i.e. instead of "TESTSTRNG" it'll print "STRNG" (I'm assuming it is a timing issue). Currently, I am trying to get the display to show all blocks, but my display is showing "alpha" (ROM C) and only displaying it on the top row. I'm using the sample init code provided in the datasheet.

/CS,/REGVDD are tied to ground.
edit: /E(/RD) tied high

Thank you
« Last Edit: March 04, 2015, 06:01:13 PM by fortey »

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #1 on: March 04, 2015, 05:17:18 PM »
You are correct about the Enable Pin, it has to be toggled from HIGH to LOW to show the data on the display.  This might solve your text being cutoff issue as you currently have no trigger to latch the data to the display.  Otherwise you can try using a longer delay before sending the data to the port.  Can you post how you have your other pins configured?

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #2 on: March 04, 2015, 05:53:24 PM »
BS2 = high
BS1 = high
BS0 = low
DB0-DB7 connected to MPU
R/W connected to MPU
RES connected to MPU
D/C connected to MPU
VDD connected to 3.3V
E was tied HIGH (made mistake on previous post) currently working on connecting to MPU
« Last Edit: March 04, 2015, 06:19:08 PM by fortey »

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #3 on: March 05, 2015, 08:03:52 AM »
I assume you've connected Chip Select (CS) on pin 15 as well since you get something on the display.  (Display on when LOW and display off when HIGH in case you were wondering)

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #4 on: March 05, 2015, 12:42:19 PM »
Yes the Chip Select pin is tied to ground.

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #5 on: March 05, 2015, 01:08:56 PM »
On page 15 of the datasheet http://www.newhavendisplay.com/specs/NHD-0216CW-AY3.pdf

The 8080-Series doesn't have timing information about the Enable(/RD) Pin. Also does the /CS need to be toggled in this case? Or can we keep it tied low?

We are ONLY to writing data to the display.

« Last Edit: March 05, 2015, 01:56:45 PM by fortey »

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #6 on: March 05, 2015, 02:15:25 PM »
As long as the display is not sharing any of the DB0-DB7 pins with another device, then you can leave CS tied to ground.  CS is used so that you could connect multiple displays to the same data lines and simply toggle CS to LOW when you want that device to receive data.

The timing diagram for RD is on page 15 of the specification sheet.

Have you gotten your display to work properly?

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #7 on: March 05, 2015, 02:48:22 PM »
Nope the display is still the same. We are only writing to the display, and there is no info about what to do with the E/RD pin during the write cycle. Can we just tie that high?

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #8 on: March 05, 2015, 04:03:27 PM »
Yes, if you're not going to read anything then you can tie that high. 

Have you written your own initialization code?  The OLED displays may be compatible with LCDs but they require a specialized initialization sequence to properly work.  You can find some sample code at the end of the specification sheet. 

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #9 on: March 05, 2015, 04:10:14 PM »
I'm using the sample code given at the end of the datasheet. The only different is that I've added delays after each command and data function.

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #10 on: March 05, 2015, 05:01:01 PM »
So how are you handling the R/W pin (which becomes the WR pin in 8080 mode) ?  That pin you should start at HIGH and then when you write something to the display, toggle it to LOW.

I will also post a follow up the next day on my end to see if I can get it to work and then post my own code for you.  Mine will be based on the Arduino but I'll be using C code and none of the built in functions  ;)

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #11 on: March 05, 2015, 05:25:48 PM »
Thanks Ratheesh.

WR# starts HIGH, D/C# is selected (starts HIGH or LOW depending on command or data), WR# goes LOW, Data goes in, WR# goes HIGH. Of course with appropriate delays in between.

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #12 on: March 09, 2015, 01:03:17 PM »
I finally got some time to write the code.  It is based off an Arduina Mega 2560 without the built-in commands.  Here:-

Code: [Select]
//Pure Port Manipulation Only!  C code FTW!
//Arduino built-in commands, HAH!
//Those .h files have been benched!!

/* Humans, this code has been setup for an Arduino MEGA 2650.
Because the Awesome Programmer is not relying on built-in
commands of the Arduino, it should be pretty easy to
transfer to another development board if need be.

Now for the pin setup (5V Arduino power in 8-bit 8080 mode):
Arduino        OLED Board
  GND            1  (VSS)
  NC             2  (VDD)
  5V             3  (REGVDD) to use 5V
  49             4  (D/C)
  48             5  (/WR replaces R/W)
  47             6  (/RD replaces E)
  22             7  (DB0)
  23             8  (DB1)
  24             9  (DB2)
  25             10 (DB3)
  26             11 (DB4)
  27             12 (DB5)
  28             13 (DB6)
  29             14 (DB7)
  37             15 (CS)  always low since only one display
  36             16 (RES) always high since no need to reset 
  35             17 (BS0)
  34             18 (BS1)
  33             19 (BS2)
  GND            20 (VSS)
*/


void setup() {
  // put your setup code here, to run once:
  DDRC |= B00011111;  //Pins 33-37 are outputs
  DDRA = 0xFF;        //All output pins
  DDRL |= B00000111;  //Pins 47-49 are outputs
 
  PORTC |= B00011010; //Display Pins 15-19 set
  PORTL |= B00000110; //RD and /WR to HIGH
 
  initializeLCD();

 
 
void loop() {
  // put your main code here, to run repeatedly:
  command(0x01); // Clear Screen
  delay(5);
  char message[] = "  NewHaven Display  ";
  char message2[] = "    International    ";
  command(0x02); // Brings The Cursor to Home Position

  for (int i = 0; i < 20; i++)
  {
    data(message[i]);
    delay(1);   
  }
 
  command(0xC0); // Brings The Cursor to Home Position

  for (int j = 0; j < 20; j++)
  {
    data(message2[j]);
    delay(1);   
  }
  delay(3000);
}

void initializeLCD(){
 
  delay(1);          //delay
  command(0x2A);     //function set (extended command set)
  command(0x71);     //function selection A
  data(0x5C);        // Set 5V on REGVDD
  command(0x28);     //function set (fundamental command set)
  command(0x08);     //display off, cursor off, blink off
  command(0x2A);     //function set (extended command set)
  command(0x79);     //OLED command set enabled 
  command(0xD5);     //set display clock divide ratio/oscillator frequency
  command(0x70);     //set display clock divide ratio/oscillator frequency
  command(0x78);     //OLED command set disabled
  command(0x08);     //extended function set (2‐lines)
  command(0x06);     //COM SEG direction
  command(0x72);     //function selection B
  data(0x40);        //ROM CGRAM selection
  command(0x2A);     //function set (extended command set)
  command(0x79);     //OLED command set enabled
  command(0xDA);     //set SEG pins hardware configuration
  command(0x10);     //set SEG pins hardware configuration
  command(0xDC);     //function selection C
  command(0x00);     //function selection C
  command(0x81);     //set contrast control
  command(0x7F);     //set contrast control
  command(0xD9);     //set phase length
  command(0xF1);     //set phase length
  command(0xDB);     //set VCOMH deselect level
  command(0x40);     //set VCOMH deselect level
  command(0x78);     //OLED command set disabled
  command(0x28);     //function set (fundamental command set)
  command(0x01);     //clear display
  delay(5);
  command(0x80);     //set DDRAM address to 0x00
  command(0x0C);     //display ON
  delay(100);        //delay
}

void command(unsigned char c){  //To send commands
   PORTA = c;                   //command on port
   PORTL &= ~B00000001;         //D/C set to LOW for command
   delay(1);
   PORTL &= ~B00000010;         //WR set to LOW for latching
   delay(1);
   PORTL |= B00000010;          //Back to normal
   delay(1);
}

void data(unsigned char d){    //To send data
   PORTA = d;                  //data on port
   PORTL |= B00000001;         //D/C set to HIGH for data
   delay(1);
   PORTL &= ~B00000010;        //WR set to LOW for latching
   delay(1);
   PORTL |= B00000010;         //Back to normal
   delay(1);
}

fortey

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #13 on: March 09, 2015, 02:13:26 PM »
Thanks Retheesh!

I was choosing the D/C line before entering the data. The display works properly now!

Retheesh_M

  • Guest
Re: NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue
« Reply #14 on: March 09, 2015, 02:23:51 PM »
Glad to hear you got it working  :)

 

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

Started by SteveCBoard Character LCDs

Replies: 3
Views: 4564
Last post May 13, 2014, 12:04:36 AM
by SteveC
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 5697
Last post November 07, 2014, 08:25:20 AM
by Michael_L
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 3401
Last post September 25, 2015, 03:09:24 PM
by Paul_B
Arduino LCD library not working with newhaven display NHD‐0420H1Z‐FL‐GWB-3V3

Started by c2hollowBoard Character LCDs

Replies: 9
Views: 8811
Last post July 10, 2014, 08:46:06 AM
by Michael_L
NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines

Started by stylonurusBoard OLEDs

Replies: 5
Views: 5574
Last post June 18, 2014, 10:09:49 AM
by Michael_L