Hi,
Maybe how data has interpreted is a problem.
LSB bits are considered during reading & writing.
- What is the PIO width set?
- Can you share your code?
Or
Try with below code.
Example1: For single bit controle consider below code and try
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, count & 0x01);
while(delay < 2000000)
{
delay++;
}
count++;
Example2: 2-PIO of 3bits of width, for switches and leads.
int in;
while (1)
{
in = IORD_ALTERA_AVALON_PIO_DATA(SW_PIO_BASE) & 0x07;//we are consedering/requried least 3bits from switch
if(in==0)//if all swith are zero
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, 0);
else if(in==1)
IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, 1);
............
}
Let me know if this has helped resolve the issue you are facing or if you need any further assistance.
Best Regards,
Anand Raj Shankar
(This message was posted on behalf of Intel Corporation)