Altera_Forum
Honored Contributor
11 years agoI2C inout simulation
I am using VHDL to try and simulate an I2C master and slave.
My slave has an inout port named i2c_sda. My master has a in port named i2c_sda_in and a output port named i2c_sda_out. In actual hardware, this assignment is very easy to do. All that needs to be done is the following: i2c_sda <= '0' when i2c_sda_out = '0' else 'Z'; i2c_master_instance : i2c port map ( master_sda_in => i2c_sda, master_sda_out => i2c_sda_out ) This does not work however for simulations. What is the work around for this? I have attempted to "switch" between the assignments using a mux but have not found a working solution yet. Thanks