Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Apps in DE2

Altera_Forum
Honored Contributor II
931 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
264 Views

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.
0 Kudos
Reply