Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Fjato
Beginner
175 Views

How do I use PIO which is configured as InOut?

Hi,

 

For a Cyclone V project I configured a PIO as InOut with a width of 1 bit in Qsys. Unfortunately I am not quite sure how to use the PIO to write and read data. So, which value do I need to write to which register to read from this PIO and which value do I need to write to which register to write from this PIO?

 

Thank you in advance.

0 Kudos
6 Replies
YuanLi_S_Intel
Employee
43 Views

Hi Fabian,

 

Apologize that i dont know which PIO you are referring to? Are you referring to IP or what?

 

Thank You.

Fjato
Beginner
43 Views

Hi Bruce,

 

sorry for the missing information. I am referring to the PIO Core with Avalon interace documented in https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/nios2/n2cpu_nii51007.pdf.

 

Thank you in advance.

sstrell
Moderator
43 Views

As the guide you pointed to states, you have to set direction in the direction register and then read or write the data register depending on the direction.

 

#iwork4intel

Fjato
Beginner
43 Views

Hi, thanks for your reply. But I am not speaking about the bidirectional setting.

The IOs can be configured as Input, Output, Bidirectional and InOut. The first three ones are self-explanatory for me and are well documented. What I would like to know is the fourth setting InOut. If setting a single IO to InOut, I have access to two IO pins in Quartus, one being fixed input and the other one being fixed output. So I doubt, that I can set the direction for the pin. Instead I would expect, that I can write data for the output pin to the data register and read data from the input pin from another data register. But I can not find out what's the correct address / offset for both data register (offset "0" and bit "1" would be the case for all the other settings Input, Output and Bidirectional).

I hope could point out a problem a bit more. Pleas let me know if I misunderstood something. Thank you in advance and best regards.

Fjato
Beginner
43 Views

Anyone, who can help? Thanks in advance and best regards.

YuanLi_S_Intel
Employee
43 Views

OK, i understand what is your question already. For InOut, you have both input and output connected to the IP. Thus, you can just read / write the register 0 without the need to set register 1. Read Register 0 if you want to get the input and write register 0 if you want to write. Register 1 is only meant for bidirectional use only.