NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue

Comments

14 comments

  • Guest

    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?

    0
  • fortey
     
    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 »
    0
  • Guest

    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)

    0
  • fortey

    Yes the Chip Select pin is tied to ground.

    0
  • fortey
    On page 15 of the datasheet https://newhavendisplay.com/content/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 »
    0
  • Guest

    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?

    0
  • fortey

    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?

    0
  • Guest

    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. 

    0
  • fortey

    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.

    0
  • Guest

    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 ;)

    0
  • fortey

    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.

    0
  • Guest

    I finally got some time to write the code.  It is based off an Arduina Mega 2560 without the built-in commands.  Here:

    //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);
    }
    0
  • fortey

    Thanks Retheesh!

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

    0
  • Guest

    Glad to hear you got it working :)

    0

Please sign in to leave a comment.