Forum Discussion
Altera_Forum
Honored Contributor
17 years agoCan a bidirectional port becomes both input and output at the same time?
I would like to create VHDL codes which are able to display data to the Input/Output port as well as receiving values of the port, if there is any changes to the port. Firstly, is it possible without...
Altera_Forum
Honored Contributor
17 years agoI am not clear what you want to say (assigning ports to it??).
A bidirectional bus is under control of two(or more devices). At any sample time, the designer has to know who should write to the bus(drive it) and who should read it. Any other drive should be cut-off including your own fpga drive if you want to read the bus inside the fpga(as input). The simple fpga method is connect the bidir pin to two internal nodes(A,B). read A anytime you want. write to port when you want to output else cut-off(so you don't read back your own drive). So you need a 3rd control signal to enable/disable the tristate buffer. A <= bidir; -- read port bidir <= B when enable = '1' else 'Z';; --write to port