Forum Discussion
Altera_Forum
Honored Contributor
14 years agoIORD 11.0 vs IORD 9.1
Hello, int main()
{
int i;
while(1)
{
i = IORD_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_BASE);
printf("PIO EDGE CAP: %d\n", i);
IOWR_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_BASE, 0x0);
usleep...
Altera_Forum
Honored Contributor
14 years agoFor a n bit PIO only lower n bits of register are significative.
The upper bits are not supposed to be initialized nor driven and must be treated as don't care. Then you must mask the valid bit field and test only this part of register output. In the case of 4bit pio: i = IORD_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_BASE) & 0x000F; So, 513 and 520 become 1 and 8. The different behaviour of these undriven bits depends on logic synthesis and sometime on previous signal status on those bit lines. So I think what you see it's pretty normal