Forum Discussion

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

DE2-70 LCD screen? Header not found? Where does altera eclipse put header files?

Hello all,

lately I've been working with a DE2-70 and for some reason eclipse can't find the header

#include "altera_up_avalon_character_lcd.h"

Now, I know this header is supposed to be there because it's provided in an example that my professor gave me.

the code given to me by mt professor (in the event that it's any help)

#include <stdio.h>#include "system.h"# include "altera_up_avalon_character_lcd.h"
int main ()
{
    alt_up_character_lcd_dev* hLCD;
    hLCD = alt_up_character_lcd_open_dev (DE270_LCD_NAME);
    if (hLCD == NULL)
    {
        printf ("Character LCD is missing\n");
        return (0);
    }
    else
    {
        printf ("Character LCD is OK\n");
        alt_up_character_lcd_init (hLCD);
    }
    int i = 0;
    char TopMsg  = "0123456789ABCDEF\0";
    char BtmMsg  = "   Hello class\0";
    while (1)
    {
        alt_up_character_lcd_init           (hLCD);
        alt_up_character_lcd_set_cursor_pos (hLCD, 0, 0);
        alt_up_character_lcd_string         (hLCD, TopMsg);
        for (i = 0; i < 15000000; i++);
        alt_up_character_lcd_init           (hLCD);
        alt_up_character_lcd_set_cursor_pos (hLCD, 0, 1);
        alt_up_character_lcd_string         (hLCD, BtmMsg);
        for (i = 0; i < 15000000; i++);
    }
    return (0);
}

So naturally I do need the header file in order to build this example. I searched my computer and could not find the header file I require anywhere. Does anyone know where the header would be? or how I can get eclipse to find it?

alternatively if it isn't there would anyone happen to have a copy of it?

6 Replies

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

    You may need to install the university program software on your computer. Recent Quartus versions include the university program stuff, but if you are using an older version you will need to go to the Altera website and download it.

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

    --- Quote Start ---

    It looks like the location where it is looking for may not be right. Try pointing to where the files are. For quartus 15:

    C:\altera\15.0\ip\altera\university_program\audio_video\altera_up_avalon_character_lcd\HAL\inc

    I'm not sure if that will work though. Good luck.

    --- Quote End ---

    I added the library with altera university program 9.1

    for my directory have c:\altera\91\ip\altera\university_program\audio_video\altera_up_avalon_character_lcd\hal\inc

    the code now sees the header file

    but it keeps flipping out over the line
    hLCD = alt_up_character_lcd_open_dev (DE270_LCD_NAME);

    even if I comment it out. I have tried cleaning, rebuilding, restarting eclipse, restarting my computer but eclipse still hates the line
    hLCD = alt_up_character_lcd_open_dev (DE270_LCD_NAME);
    regardless if commented out or not idk y.

    the project will not build either because of this mysterious problem

    my code currently

    
    # include <stdio.h># include "system.h"# include "C:\altera\91\ip\altera\university_program\Audio_Video\altera_up_avalon_character_lcd\HAL\inc\altera_up_avalon_character_lcd.h"# include "C:\altera\91\ip\altera\university_Program\Audio_Video\altera_up_avalon_character_lcd\HAL\inc\altera_up_avalon_character_lcd_regs.h"
    int main ()
    {
        alt_up_character_lcd_dev* hLCD;
      hLCD = alt_up_character_lcd_open_dev (DE270_LCD_NAME);
        if (hLCD == NULL)
        {
            printf ("Character LCD is missing\n");
            return (0);
        }
        else
        {
            printf ("Character LCD is OK\n");
            alt_up_character_lcd_init (hLCD);
        }
        int i = 0;
        char TopMsg  = "0123456789ABCDEF\0";
        char BtmMsg  = "   Hello class\0";
        while (1)
        {
            alt_up_character_lcd_init           (hLCD);
            alt_up_character_lcd_set_cursor_pos (hLCD, 0, 0);
            alt_up_character_lcd_string         (hLCD, TopMsg);
            for (i = 0; i < 15000000; i++);
            alt_up_character_lcd_init           (hLCD);
            alt_up_character_lcd_set_cursor_pos (hLCD, 0, 1);
            alt_up_character_lcd_string         (hLCD, BtmMsg);
            for (i = 0; i < 15000000; i++);
        }
        return (0);
    }
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    terms like "flipping out" and "hates the line" are meaningless. Please post the exact error message.

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

    --- Quote Start ---

    terms like "flipping out" and "hates the line" are meaningless. Please post the exact error message.

    --- Quote End ---

    the exact error message is undefined reference to alt_up_character_lcd_open_dev
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    OK, much better. Undefined reference means that when the linker was trying to create your executable it couldn't find alt_up_character_lcd_open_dev. So you need to add the code for that routine to your build. To add a source file to your build, either copy it to your project directory with your other source or drag it from windows explorer to your project in eclipse. After doing that, delete your objects directory (probably Debug or Release) so that the makefile is recreated and then your build should work.

    The source file is the avalon_up_avalon_character_lcd\HAL\src directory.