Forum Discussion
Altera_Forum
Honored Contributor
20 years agoC++ help in NIOS
Hello, I am a newbie with NIOS. I was able to successfully run the "hello world" program on my board... I was just wondering if there is some type of documentation on the internet that will tea...
Altera_Forum
Honored Contributor
20 years agoIn your Nios documentation, there is a chapter for each of the various peripheral devices. The one you're looking for is the PIO device. You need to add a PIO device to your SOPC project, then look in the system.h file in your system library to find the definition of the PIO's base address. Then, in your main, you'll have some code like this:
# include "system.h"# include "altera_avalon_pio_regs.h" ... IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, 0); // Base address and value.