Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16557 Discussions

Bidirectional pin problem

Altera_Forum
Honored Contributor II
1,259 Views

Hi, 

 

I am using bidirectional SDIO pin for implementing an ADC SPI controller. 

As the ADC doesn't have separate SDO line, I Am left with no choice but to use the bidirectional pin. 

 

The controller takes RD/WR,DATA and ADDRESS LINE as input. 

 

In the beginning of each cycle it writes the RD/WR and ADDRESS signal to the ADC through SDIO line. 

 

Then depending on the RD/WR signal it switches its polarity to either write DATA into ADC through that SDIO line or read data from ADC using the same SDIO line. 

 

I am getting no error during synthesis. 

 

But as I try to simulate the same, the SDIO line gets into 'X' state at all those points where a transition in its value is expected. 

 

Please help me with the same. 

 

I have attached my code and testbench and application note related to the same
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
271 Views

Its because you've enabled the sdio from the testbench and inside the entity. So both are driving the bus at the same time. You need to ensure one side is always 'Z'. 

 

Looking at the waveform, tri_en = '0', and bus_en = '1' (whcih sets tri_en internally to '0'), so the TB and the spi_interface are driving the same wire.
0 Kudos
Reply