[NHD-0420CW-Ax3] Start my display in C language

Comments

3 comments

  • Ted M.
    NHD Staff

    Hi Arrgon,

    Below are the commands necessary to initialize the display.  Additional support code can be found in our datasheet:
    https://newhavendisplay.com/content/specs/NHD-0420CW-AW3.pdf 
     
    More example code can also be found on our Github site:

    https://github.com/NewhavenDisplay/NHD_US2066

    void init()
    {
    RES = 1;                 //reset HIGH – inactive
    delayms(1);            //delay
    command(0x2A);    //function set (extended command set)
    command(0x71);    //function selection A
    data(0x00);            // disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
    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(0x09);    //extended function set (4-lines)
    command(0x06);    //COM SEG direction
    command(0x72);    //function selection B
    data(0x00);           //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
    command(0x80);   //set DDRAM address to 0x00
    command(0x0C);   //display ON
    delayms(100);       //delay
    }
    Please let me know if you have any questions.
    « Last Edit: February 21, 2018, 09:25:08 AM by Ted_M »
    0
  • arrgon

    Thank you so much for your help.

    I know and I use the datasheet. thanks anyway.

    Github : For my code the problem is that I have to use it without all the arduino's functions wire.begin etc...  I only have to control it in i2c and not in spi as in the example provided.

    that's why I do not know how to do.
    Thanks a lot.

    0
  • Ted M.
    NHD Staff

    Hi Arrgon,

    Have you been able to resolve this issue?

    0

Please sign in to leave a comment.