Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21611 Discussions

Another character LCD question

Altera_Forum
Honored Contributor II
1,050 Views

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 # endifIn SOPC builder my LCD device is named "lcd", so I'm not sure what the problem is here.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
324 Views

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.
0 Kudos
Reply