Altera_Forum
Honored Contributor
18 years agoBidirectional pin help!
Hi,
I have a I2C code which sends write only data from my fpga to the audio codec on the board. The code is fine apart from one part After 8 bits of transfered data from the fpga to the audio codec, the audio codec sends back 1 acknowledgement bit. (So, obviously, i have made the data line, SDA, a bidirectional pin) The problem I am having is testing this returned acknowledgement signal from the codec. a little snippette of my code is simple, but incorrect. s8: begin if(SDA == 1'b0) pres <= s2; else pres <= s8; end I want to be able to see if SDA is pulled low by the external source before moving states. I believe I need an output enable, but what do I need to do to get this to work? Idealy i want to get this to work in both simulation and in reality. As you can imagine, it would be hard test if the ack has been sent due to the fact the audio codec chip in integrated on the board.