Forum Discussion
Altera_Forum
Honored Contributor
19 years ago --- Quote Start --- originally posted by theguru@Mar 20 2007, 02:49 PM i'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
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=22367)</div> --- Quote End --- Thansk Blair. Will test that out and see what happens...