Forum Discussion
Altera_Forum
Honored Contributor
13 years agoRead back PIO output status
I have a Qsys PIO component that is 7 bits wide. It is configured as an output (it drives 7 LEDs). I would like to be able to determine which bits of the output are set and which are cleared (or al...
Altera_Forum
Honored Contributor
13 years agoI actually found the answer to this question on page 10-6 of this document.
Heres the document the forum won't let me post links. Do a google search for Altera embedded peripherals IP user guide. According to the documentation, what I want to do is not possible. data Register Reading from data returns the value present at the input ports. If the PIO core hardware is configured in output-only mode, reading from data returns an undefined value. Writing to data stores the value to a register that drives the output ports. If the PIO core hardware is configured in input-only mode, writing to data has no effect. If the PIO core hardware is in bidirectional mode, the registered value appears on an output port only when the corresponding bit in the direction register is set to 1 (output). If anyone has a different answer than this, I'd be interested to know it.