Forum Discussion
Altera_Forum
Honored Contributor
8 years agoPio write data error
Hi all, I am using IOWR_ALTERA_AVALON_PIOS macros to write data onto pios. But when I am writing the data onto 1 pins, all the other pins are assigned the same value at the same time. Does any...
Altera_Forum
Honored Contributor
8 years agoHi,
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?
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)