FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5159 Discussions

How do I use PIO which is configured as InOut?

Fjato
Beginner
352 Views

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
7 Replies
YuanLi_S_Intel
Employee
220 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
220 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
Honored Contributor III
220 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
220 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
220 Views

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

YuanLi_S_Intel
Employee
220 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.

 

DylanD
Beginner
52 Views

Hello, I'm trying to do the same thing as Fjato. What are you referring too when you say register 0 and register 1?

Reply