Altera_Forum
Honored Contributor
14 years agoMux INOUT port in VHDL
Hi all!
Currently I'm trying to connect my I2C master module to one of four I2C slaves using a mux without success: I can't get the bidirectional SDA signal to correctly mux. The code is as follows:mux_sda: process (sel, i_sda_o, sda)
begin
sda <= (others => 'Z');
if i_sda_o = '0' then
sda(sel) <= '0';
end if;
end process;
i_sda_i <= to_x01(sda(sel));where - sda is a vector of SDA pins on the FPGA declared as INOUT,
- i_sda_o the internal SDA output from the I2C Master to driver SDA,
- i_sda_i the internal SDA input to the I2C Master to read SDA and
- sel an integer used to select the pin to connect the master to.