Forum Discussion
Altera_Forum
Honored Contributor
19 years agoI've created a design with the following components:
Nios II/s Onchip memory - 32 KB PIO 0 - 18 output only - Base address 8800 - Connected to the Red LEDs PIO 1 - 18 input only - Base address 8810 - Connected to the Switches Ran the following code which continuously reads the switches and writes their values to the LEDs:#include <io.h>
void main(void)
{
int sw_data;
while (1)
{
sw_data = IORD_32DIRECT(0x8810, 0);
IOWR_32DIRECT(0x8800, 0, sw_data);
}
return;
} Seems to work. A Common Pitfall: - Not assigning pins to signals in the assignment editor. Good luck, Blair