Altera_Forum
Honored Contributor
19 years agoBase addresses and system.h #define
I have an SOPC system with some custom components and 2 Altera PIO components. I am trying to write to a PIO using this function, for example:
IOWR(PIO_0_BASE, 3, 0x0); // Clear edge capture register However, I get a compile error saying that PIO_0_BASE is undeclared, even though i am doing a# include "system.h" at the top of my code. Isn't that the preferred way to access components in the system? My code will work if I copy this file from system.h into my code: # define PIO_0_BASE 0x00010800 But that defeats the purpose of having all the registers defined in one place! I was under the impression (from reading the niow SW dev manual) that you don't normally have to explicity# include system.h. anyway. Any ideas on what I'm doing wrong? I'm relatively new to C AND the Nios so this may be a C newbie error or a Nios newbie error. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif