Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

ERROR in Character LCD Cyclone III dev kit

Altera_Forum
Honored Contributor II
1,239 Views

I have a SOPC set up with a CPU Processor, On-Chip memory, JTAG UART, and Character LCD. The clock is 50 Mhz.  

 

LCD_E_from_the_lcd_0 --> lcd_en [PIN_AC24] (set OUTPUT) 

LCD_RS_from_the_lcd_0 --> lcd_d_cn [PIN_D27] (set OUTPUT) 

LCD_RW_from_the_lcd_0 --> lcd_wen [PIN_AC4] (set OUTPUT) 

LCD_data --> lcd_data[7..0] (set INOUT) 

 

I do NOT have "Reduced device drivers" checked, because the LCD drivers do not provide small drivers. 

My code in NIOS II is : 

 

 

#include <stdio.h> 

#include <system.h> 

 

 

 

 

#define ESC_TOP_LEFT "[1;0H" 

 

 

#define ESC_BOTTOM_LEFT "[2;0H" 

 

 

#define LCD_CLR "[2J" 

 

 

#define LCD_CLR_LINE "[K" 

 

 

static unsignedchar ESC = 0x1b;  

 

 

void lcd_hello(void

FILE* LCD; 

 

 

 

LCD = fopen (LCD_0_NAME, "w"); 

 

if(LCD == NULL) { 

 

 

printf("LCD open failed\n"); 

 

 

}  

else

printf("LCD open succeeded\n"); 

 

 

 

 

fprintf(LCD, "%c%s", ESC, LCD_CLR); // Clears LCD 

 

 

fprintf(LCD, "LCD demo using\n"); 

 

 

fprintf(LCD, "altera HAL in C"); 

 

 

 

fclose(LCD); 

 

 

 

int main (void){ 

 

 

LCD_hello(); 

while(1); 

return 0; 

Is my code wrong? My kit (LCD) does't work. Thank u 

 

 

0 Kudos
0 Replies
Reply