This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

lcd interface

Dear Sir,

I want interface 16*2 lcd with nordic nrf52832.

Please provide me details and example code.

Thanks 

Shivali

  • Hi Shivali,

    Unfortunately I cannot recommend you any LCD displays.

    Hopefully someone from the community can help you out.

     

    I see that someone has made a similar thread, which can be of help.

     

     

  • Hi sir i m trying to interface 16*2 lcd,

    I have write the code but i got issues in how can define ra en and data pin ,

    please check my below code.

    #define rs P0_13 //P1.08
    #define en P0_7 //P1.07
    #define lcdport (P0_8, P0_7, P0_6, P0_5)


    void delay(int itime)
    {
    int i,j;

    for(i=0;i<=itime;i++)
    for(j=0;j<=1275;j++);

    }

    void daten(void)
    {
    rs=1;
    en=1;
    delay(10);
    en=0;
    }
    void lcddata(unsigned char ch)
    {
    lcdport=ch & 0xf0;

    daten();
    lcdport=ch<<4 & 0xf0;
    daten();
    }
    void cmden(void)
    {
    rs=0;
    en=1;
    delay(10);
    en=0;
    }
    void lcdcmd(unsigned char ch)
    {
    lcdport=ch & 0xf0;

    cmden();
    lcdport=ch<<4 & 0xf0;
    cmden();
    }
    void lcdstring(char *str)
    {
    while(*str)
    {
    lcddata(*str);
    str++;
    }
    }
    void lcd_init(void)
    {
    lcdcmd(0x02);
    lcdcmd(0x28);
    lcdcmd(0x0e);
    lcdcmd(0x01);
    }

    //-------------------------------------

    Please let me how i can define rs en and data pin pls.

    Thanks & Regards

    Shivali Singh

  • Hello Shivali,

    This thread has been inactive for almost a year.
    Please make a new thread with your question.

    Best Regards,

    Martin L.

  • Whilst I understand what Martin has said about making a new thread, I will say this.
    I intergrated a 16*2 LCD into a raspberry pi so I know a bit about LCDs. Pin RS is just a pin for setting whether the LCD is in command mode or character mode. i.e. whether the incoming data is for the LCD itself or information to be sent to the screen. This pin doesn't require EN to be driven HIGH and then LOW again as it doesn't get polled like the data pins.

    The EN pin is a stimulation pin that will tell the LCD when to read the data pins. When it goes HIGH, the LCD will poll the data pins, it must then be sent to LOW again before changing the data pins.

    As you are using the LCD in 4 data pin mode, you need to send the full byte in 2 nibbles, sending the first nibble, stimulating the EN pin, then the second nibble and stimulating the EN pin again.

    Your LCD is probably a little different but the basic functions should be the same.

    Happy LCD'ing, I had great fun designing an nRF52 programmer with an LCD.

Related