Forum Discussion

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

Another character LCD question

I am using the Cyclone Edition dev kit and I've built a basic Nios II system, and loaded the "count_binary" example program using the Eclipse for Nios II software.

If I set stdout to the LCD then it displays the countdown, but I didn't think that this was necessary. Without this setting the LCD just stays blank.

In count_binary.h there is this section that defines LCD-PRINTF:

#ifndef LCD_DISPLAY_NAME
/* Some hardware is not present because of system or because of simulation */#    define LCD_CLOSE(x) /* Do Nothing */#    define LCD_OPEN() NULL#    define LCD_PRINTF(lcd, args...) fprintf(lcd, args)
# else
/* With hardware devices present, use these definitions */#    define LCD_CLOSE(x) fclose((x))#    define LCD_OPEN() fopen("/dev/lcd_display", "w")#    define LCD_PRINTF fprintf
# endif
In SOPC builder my LCD device is named "lcd", so I'm not sure what the problem is here.

1 Reply

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

    There were a couple of naming mismatches that caused this problem:

    1. count_binary.c was checking if LCD_DISPLAY_NAME had been defined, but system.h used LCD_NAME.

    2. count_binary.h looked for /dev/lcd_display, but my device was actually at /dev/lcd.

    I hope this will be useful to someone in the future. The program worked properly after I changed these two things and set stdout back to jtag_uart.