Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

LCD on NIOSII

I have built my NIOS II system on DE2 board having DRAM, JTAG UART and 16207 LCD. This is my code in NIOS II IDE:

---------------------------------------------# include <stdio.h># include "system.h"

int main()

{

FILE *fp=0;

fp = fopen( "/dev/lcd_16207_0", "w");

if (fp==0)

printf("lcd not ready...\n");

else

{ printf("lcd ready...\n");

fprintf(fp, "hello lcd...\n");

}

fclose(fp);

return 0;

}

----------------------------------------------

everything seems ok, but I dont know why LCD does not work.

PLEASE HELP ME...

Thanks alot

Lili

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by lili@Feb 11 2007, 07:41 PM

    i have built my nios ii system on de2 board having dram, jtag uart and 16207 lcd. this is my code in nios ii ide:

    ---------------------------------------------# include <stdio.h># include "system.h"

    int main()

    {

    file *fp=0;

    fp = fopen( "/dev/lcd_16207_0", "w");

    if (fp==0)

    printf("lcd not ready...\n");

    else

    { printf("lcd ready...\n");

    fprintf(fp, "hello lcd...\n");

    }

    fclose(fp);

    return 0;

    }

    ----------------------------------------------

    everything seems ok, but i dont know why lcd does not work.

    please help me...

    thanks alot

    lili

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=21438)

    --- quote end ---

    --- Quote End ---

    Take a look at the following link. He forgot to turn the LCD on inside his code. Hope that helps a little.

    http://forum.niosforum.com/forum/index.php...pic=5081&hl=lcd (http://forum.niosforum.com/forum/index.php?showtopic=5081&hl=lcd)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I use lcd display like this and it works well

    FILE *lcd;

    lcd = fopen("/dev/lcd_display", "w");

    /* Write some character to the LCD. */

    if (lcd != NULL )

    {

    fprintf(lcd, "%c", ESC);

    fprintf(lcd,"[%c", y);

    fprintf(lcd, "%c", ESC);

    fprintf(lcd,"%cH", x);

    }

    fclose( lcd );

    Many regards Marcin.