Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: EP3C120F780 Character LCD not cooperating

  1. #1
    Join Date
    Jan 2009
    Posts
    30
    Rep Power
    1

    Default 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 Guynes

  2. #2
    Join Date
    May 2008
    Location
    Norway
    Posts
    4,165
    Rep Power
    1

    Default Re: EP3C120F780 Character LCD not cooperating

    Have a look at my post here. The documentation for the Cyclone III development kit is wrong: the enable signal for the character LCD is pin AC24, not AB24.

  3. #3
    Join Date
    Jan 2009
    Posts
    30
    Rep Power
    1

    Default Re: EP3C120F780 Character LCD not cooperating

    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

  4. #4
    Join Date
    Jan 2009
    Posts
    30
    Rep Power
    1

    Default Re: EP3C120F780 Character LCD not cooperating

    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
    Last edited by wguynes; February 7th, 2009 at 02:58 AM. Reason: Bad speller... ick

  5. #5
    mark.hellmanns Guest

    Default Re: EP3C120F780 Character LCD not cooperating

    Hi,

    do you have an example for the character LCD? The LCD doesn't react.

  6. #6
    Join Date
    Jan 2009
    Posts
    30
    Rep Power
    1

    Default Re: EP3C120F780 Character LCD not cooperating

    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

  7. #7
    mark.hellmanns Guest

    Default Re: EP3C120F780 Character LCD not cooperating

    Dear William,

    can you send it by mail?

    mark@hellmanns.de

    Thanks.

  8. #8
    mark.hellmanns Guest

    Default Re: EP3C120F780 Character LCD not cooperating

    I fixed it. There was a spelling error (lcd_d_wen instead of lcd_wen).

    Thank you all.

  9. #9
    Join Date
    Apr 2009
    Posts
    9
    Rep Power
    0

    Default Re: EP3C120F780 Character LCD not cooperating

    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.

  10. #10
    Join Date
    Mar 2009
    Posts
    51
    Rep Power
    1

    Default Re: EP3C120F780 Character LCD not cooperating

    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/exampl...cro_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);
    }

Similar Threads

  1. driving character lcd
    By wanida in forum Development Kit Related
    Replies: 5
    Last Post: September 22nd, 2013, 08:14 PM
  2. Software problem - Character LCD core HAL
    By cmanubc in forum University Program
    Replies: 1
    Last Post: December 22nd, 2008, 07:22 PM
  3. A UART question related to character READ
    By phil_rozario in forum FPGA, Hardcopy, and CPLD Discussion
    Replies: 1
    Last Post: October 3rd, 2008, 11:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •