Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

IORD 11.0 vs IORD 9.1

Altera_Forum
Honored Contributor II
1,048 Views

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/
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
303 Views

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.
0 Kudos
Reply