Hi
I am new to VHDL. I am trying to implement I2C slave and have problem ACKing the 9th bit in the SDA line.
Basically I have a Master sending the Slave address and as a Slave on the CPLD, i tried to do ACK on the SDA line but I only get a glitch instead of a low for ACK. Can you please help?
I have a bit counter that count the incoming bits of the SCL. For every falling edge on the SCL, the BitCounter counts by one. On the falling edge of the 8th clock, the BitCounter = 9.
Then when I detect the rising edge of the next SCL (9th), I tried to pull the SDA low but I only get a glitch.
Here is my code,
SDen <= '1' when ((BitCounter = 9) and (SCL_int='1')) else '0';
SDen is the signal I used to change the SDA line from 'Z' to a output Low. It is connected to the upper level and is connected to OE.
SDen => OE
On the top level, I have OE change SDA to output low. SDA is declared as an inout pin.
SDA <= '0' when OE = '1' else 'Z';
Can you please help?
Thanks
VHDL new
I am new to VHDL. I am trying to implement I2C slave and have problem ACKing the 9th bit in the SDA line.
Basically I have a Master sending the Slave address and as a Slave on the CPLD, i tried to do ACK on the SDA line but I only get a glitch instead of a low for ACK. Can you please help?
I have a bit counter that count the incoming bits of the SCL. For every falling edge on the SCL, the BitCounter counts by one. On the falling edge of the 8th clock, the BitCounter = 9.
Then when I detect the rising edge of the next SCL (9th), I tried to pull the SDA low but I only get a glitch.
Here is my code,
SDen <= '1' when ((BitCounter = 9) and (SCL_int='1')) else '0';
SDen is the signal I used to change the SDA line from 'Z' to a output Low. It is connected to the upper level and is connected to OE.
SDen => OE
On the top level, I have OE change SDA to output low. SDA is declared as an inout pin.
SDA <= '0' when OE = '1' else 'Z';
Can you please help?
Thanks
VHDL new