Forum Discussion

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

Apps in DE2

Hi,

I&#39;m a newbi and i want to know how to create an application with the basic knowledge that i have took in the DE2 tutorial. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif

I want that my apps put on a green led when a button is on. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif I make this C source :

#include <stdio.h># define led_green (char*) 0x009000C0 // Base adress in SOPC Builder# define button_pio (volatile char*) 0x00900120 // Base adress in SOPC Builder
int main(void)
{
    printf("Hello World\n");
    while(1)
    {
          printf("Loop Text Test ")
          *led_green=*button_pio;
    }
     return 0;
}

My program bug at the while, is there anyone who can tell me why ??? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif

Thank you

XR

NB : Sorry for my englihs, i&#39;m french http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/rolleyes.gif

1 Reply

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

    You will have to turn on the address bit 31 of your port address to uncache the port access.

    Or you may use the port defs in linux-2.6.x/include/nios2_sytem.h, eg, na_pio_x etc.