Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Hardware connection to FPGA

Altera_Forum
Honored Contributor II
1,450 Views

Hi... 

 

I need small help.. 

 

I have Encoder which has one input MTINP (3 bit/3 wire) and MTOUT (3 wire/3 bit).now i want to connect to this pins to FPGA(EP1C3 module)..if suppose i will rotate Encoder shaft then it will generate output..Now here i want to connect this output to FPGA (using VHDL)so i have made like.. 

 

MTOUT : in std_logic_vector(2 downto 0); // Output of Encoder is the input for FPGA 

 

I need this output in FPGA for further process..here i also need MTIN for some application in FPGA..But here i dont know how to define in VHDL.. 

 

MTIN : in std_logic_vector(2 downto 0); 

 

is it correct ?? ie i declared MTIN as input for FPGA coz here its my input for Encoder.. am i right or wrong ?? i dont have logic diagram or any logic circuit because i will connect my encoder pin to FPGA but i dont know how to define MTIN and what precaution do i need ?? 

 

Thanks a lot..
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
717 Views

If I understood You correctly, You want to create a bidirectional port. There, You must create a tri-state buffer. It may look something like this: 

 

Port : inout std_logic_vector (2 downto 0); 

 

And then in architecture section you must define tri-state buffer: 

 

Port <= Port_out when Out_enable = '1' else (others => 'Z'); 

 

If You want to use Port as output You must turn Out_enable signal to '1'. Otherwise it will work as input. 

 

Hope I made it clear to You :)
0 Kudos
Reply