Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20801 Discussions

Utilizing tristate (bi-directional) pins

Honored Contributor II

I have a i2c master component, the i2c lines (SDA, SCL) are tristate, either pulling the physical pin down, or to Z state. The simulation is working well, and now I am making my own component in Qsys. My question is, how to export these 2 lines (SDA, SCL), is their interface a "conduit" or "tristate conduit master" ?. I have checked the documentation (, and it seems to me, that TCM (Tristate Conduit Master) is a special piece of hardware with avalon inside FPGA, and tristate bi-directional pins on the "outside", this is not my case, as I have my own logic inside the core. 


definition of signals in my VHDL code is as follows :  


scl <= scl_pad_o when (scl_padoen_o = '0') else 'Z'; 

sda <= sda_pad_o when (sda_padoen_o = '0') else 'Z'; 

scl_pad_i <= scl; 

sda_pad_i <= sda;  


does the above VHDL code implies tristate behaviour of the external pins, when I declare the "sda" and "scl" signal with "conduit" interface and export them in Qsys ? Or do I need to break the above signals into "scl_pad_o", "scl_pad_i" and "scl_padoen_o" to export them under tcm interface


I would be glad to know more about interfacing with physical pins, and also whether Qsys understands these implications in VHDL (as above). And what the "conduit" interface is actually capable of.
0 Kudos
1 Reply
Honored Contributor II

First of all, are you using the off-the-shelf I2C component in Qsys (Altera Avalon I2C (Master))? Check the embedded IP user guide for details ( The guide describes how to set up the I2C connection (pdf page 515), mentioning to instantiate the I/O buffers instead of coding it directly. Your code looks correct, through, for bidirectional I/O. 


"Conduit" refers to any Qsys interface that is made up of signals that do not conform to a standard interface supported by Qsys, such as Avalon or AXI. They are usually exported out of a system. A TCM just refers to a master interface that connects, via a conduit, to an external tri-state bus. It does not directly refer to the tri-state hardware found in the I/O cells. TCM is usually found when connecting the Generic Tri-state controller to either the tri-state pin sharer or directly to the tri-state conduit bridge.
0 Kudos