Forum Discussion
EP3C120F780 Character LCD not cooperating
Kit: Altera Dev Kit EP3C120F780
I am attempting to get the Character LCD working with NIOS II control. According to the documentation if I have set it up correctly then a simple printf() statement will redirect to the Character LCD. I have a SOPC set up with a NIOS 2 Processor, On-Chip memory, a JTAG UART, and a Character LCD. I clocking at 100Mhz from a PLL. (It began as the VIP megafunction reference design that I have stripped down.) I have wired the lcd_0 outputs to the pins like this... LCD_E_from_the_lcd_0 --> lcd_csn [PIN_AB24] LCD_RS_from_the_lcd_0 --> lcd_d_cn [PIN_D27] LCD_RW_from_the_lcd_0 --> lcd_wen [PIN_AC4] LCD_data_to_and_from_the_lcd_0[7..0] --> lcd_data[7..0] [PIN_AA4, AD1, V8, AB5, AE2, V5, V6, AB3] In the NIOS II I have made sure to have the system library direct stdout to lcd_0 instead of the jtag_uart. A printf() prints no text. No reaction whatsoever from the LCD. There is a configuration or initialization I am missing. I do NOT have "Reduced device drivers" checked, because the LCD drivers do not provide small drivers. Although this involves NIOS II, I ask this here because it's device specific to the Character LCD megafunction by Altera and my particular dev kit. William Guynes16 Replies
- Altera_Forum
Honored Contributor
Have a look at my post here (http://www.alteraforum.com/forum/showthread.php?t=2609). The documentation for the Cyclone III development kit is wrong: the enable signal for the character LCD is pin AC24, not AB24.
- Altera_Forum
Honored Contributor
Thank you. I have now changed that pin. This evidently was not my only problem. The Character LCD still refuses to react. Still looking for possible problems.
I have built a flashing LED in with my clock to show that the design is definitely running. William Guynes - Altera_Forum
Honored Contributor
I got it. My cpu_resetn was wrong, causing the NIOS II to not get started up. This became obvious when my blinker was dutifully showing me the circuit was working but the NIOS did nothing.
Thanks for your help! William Guynes - Altera_Forum
Honored Contributor
Hi,
do you have an example for the character LCD? The LCD doesn't react. - Altera_Forum
Honored Contributor
It appears I do not have attachment privileges anywhere on the site. I can see what valid file extensions are, but it never actually lets me choose an attachment filename.
I also don't have any WYSIWYG or enhanced editing ability either, even though I configure them in User Control Panel. William Guynes - Altera_Forum
Honored Contributor
Dear William,
can you send it by mail? [email protected] Thanks. - Altera_Forum
Honored Contributor
I fixed it. There was a spelling error (lcd_d_wen instead of lcd_wen).
Thank you all. - Altera_Forum
Honored Contributor
Hello Mr William Guynes,
I need some help to understand how the character LCD works with Nios control. I need to start somewhere earlier to understand. I just want to display output of arithmetic module to the lcd. From the output of the module, how do I connect it to the Nios control? Is the Nios instantiated from the Megafunction, and available in the web edition? If I can at least know how it works roughly I can go about trying it out. Thanks. - Altera_Forum
Honored Contributor
I use the following code for Cyclone II. I suppose should be the same for Cyclone III using HAL.
Hope it helps. # include <stdio.h> # include "system.h" ///// LCD control: ////////////////////////////////////////////////////// // From: http://www.altera.com/support/examples/nios2/exm-micro_mutex.html // ESC sequences: // From: http://www.isthe.com/chongo/tech/comp/ansi_escapes.html // ESC[#;#H Moves the cursor to line# , column# // ESC[2J Clear screen and home cursor // ESC[K Clear to end of line # define ESC_TOP_LEFT "[1;0H" # define ESC_BOTTOM_LEFT "[2;0H" # define LCD_CLR "[2J" # define LCD_CLR_LINE "[K" static unsigned char ESC = 0x1b; // Integer ASCII value of the ESC character void LCD_hello(void) { FILE* LCD; LCD = fopen ("/dev/lcd", "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); } - Altera_Forum
Honored Contributor
hi to everyone!
i'm newbie with all the altera quartus/nios stuff. i have a dsp cyclone III dev kit (EP3C120F780). I'm trying to show some characters on the lcd, but it doesnt work and i dont know whats wrong with my design. i 've used sopc to build up the system, and this is how it looks: http://img197.imageshack.us/img197/1317/nios.jpg I've tried to put the enable signal to the lcd on both pins (ab24 and ac24), but the lcd doesnt shows anything. The code i'm using it's the one that jrierab posted some days ago. does anyone have an idea of what's wrong in my design? thanks so muck in advance.