Forum Discussion
Altera_Forum
Honored Contributor
10 years agoYou can find the PIO component documentation here: https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/ug/ug_embedded_ip.pdf
The PIO supports a combined input/output mode in two ways. One mode has separate input and output ports so that when you write to the data register it is sent to the output and when you read from the data register the input is returned to the requesting master. The other mode uses bidirectional data which means that a single tri-state interface is exposed (Verilog it's inout, I forget what VHDL calls it) which means you have to write to the direction register to control whether that tri-state port drives out the data or if it reads data. Bidirectional ports can only drive a 0, drive a 1, or be an input so that's why you have to select it's direction by setting up the direction register.