Forum Discussion
Altera_Forum
Honored Contributor
16 years agoPIO set and clear bits
Hi! I am using a Nios II in my Cyclone II FPGA. I configured the Nios with a 18bit output-PIO. When i use the macro IOWR_ALTERA_AVALON_PIO_DATA() i can easily turn my leds on and off. Looking ...
Altera_Forum
Honored Contributor
16 years agoHi Cris!
Yes, now it works (The macros IOWR_ALTERA_AVALON_PIO_SET_BITS() and IOWR_ALTERA_AVALON_PIO_CLEAR_BITS() work). After i have recreated my nios with sopc builder from scratch it suddenly worked. No change to my c-code. My pio still has a width of 18 bit. Just to sum it up for the thread followers: The macros IOWR_ALTERA_AVALON_PIO_SET_BITS() and IOWR_ALTERA_AVALON_PIO_CLEAR_BITS() did not work because i missed to enable the individual bit setting/clearing when i set up the pio in the sopc builder. After enabling it and a nios rebuild the macros work fine. Thanks for that advice Cris! Best regards FredFlintstone