Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

IORD 11.0 vs IORD 9.1

Hello,

Code:

--- Quote Start ---

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(1000000);

}

}

--- Quote End ---

BUTTON is a 4-bit PIO in my SOPC.

If I run this code with Nios II 9.1 I read: PIO EDGE CAP: 0

If I press BUTTON[0] I read: PIO EDGE CAP: 1

..

If I press BUTTON[3] I read: PIO EDGE CAP: 8

Now:

If I run the same code with Nios II 11.0 I read: PIO EDGE CAP: 512

If I press BUTTON[0] I read: PIO EDGE CAP: 513

..

If I press BUTTON[3] I read: PIO EDGE CAP: 520

What does it means?

http://bestringtones.mobi/zedge-ringtones/

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Decimal 513 = Hex 201

    Decimal 520 = Hex 208

    Then the changing bits are the same in both versions

    Since it's a 4-bit PIO you must consider the bits above 4 as "don't care". Their status is not deterministic.