Forum Discussion

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

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

16 Replies

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

    LCD_data_to_and_from_the_lcd_display needs to be bi-directional....not an output.

    Cheers,

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

    problem solved.

    uraslacker, thank you so much for your answer. i know that pins must be bidirecctional, but i read somewhere that we couldnt read from the lcd display, only write to, so because of that i declared that pins as output only! :)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi All

    I'm having a very similar problem, and maybe for you could be easier to help me to solve:

    I can't perform a right association between LCD and NIOS into vhdl code main project that create the connection between entities.

    In particular I can't exactly understand why SOPC builder create the following interface for LCD:

    component lcd_0 is

    port (

    -- inputs:

    address : IN STD_LOGIC_VECTOR (1 DOWNTO 0);

    begintransfer : IN STD_LOGIC;

    clk : IN STD_LOGIC;

    read : IN STD_LOGIC;

    reset_n : IN STD_LOGIC;

    write : IN STD_LOGIC;

    writedata : IN STD_LOGIC_VECTOR (7 DOWNTO 0);

    -- outputs:

    LCD_E : OUT STD_LOGIC;

    LCD_RS : OUT STD_LOGIC;

    LCD_RW : OUT STD_LOGIC;

    LCD_data : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);

    readdata : OUT STD_LOGIC_VECTOR (7 DOWNTO 0)

    );

    end component lcd_0;

    How can I connect all these "signals" with processor?

    Could anyone help me?

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

    The connection between the LCD component and the Nios CPU needs to be done inside SOPC builder, not outside. Connect the LCD's avalon slave interface to the Nios data master.

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

    Hi

    really thanks to all.. Same minutes after posted this issue I've understood the issue and create the right assignment.

    Quartus compilation now working fine but NIOS still create issue, I hope by using suggestion in the forum to solve final issue on LCD.

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

    Hi All

    I'm not using printf() but AVALON messages in order to send to LCD characters. After iniziliztion procedure I can see on LCD very strange characters, how is it possible?

    with default SW on DE0 board LCD working properly but I'm not so sure if LCD pinout could provide on LCD a very strange set of characters instead of normals.

    Could someone help me?

    Thanks