chrisistoocool
Newbie level 4
I2c Master - Can't receive ack from slave
https://pastiebin.com/embed/5cfb27b5a120a <-- Master
https://imgur.com/aZ76pCF <--- Block Diagram
https://imgur.com/8nqwfJh <-- Pin editor
https://imgur.com/bHPApTf <-- Simulation
Right now I have a master that was based off of Pedroni's i2c generic master from Finite State Machines, originally I had SDA <= 'Z' in the states I needed and then assigned SDA <= '1' or '0' for commands/addresses. This did not work unfortunately. So I did some reading and read that to incorporate a proper open drain I should do SDA <= '0' when <condition> else 'Z'. So I did this instead; still nothing. Then I tried to do a weak pull-up resistor too, but to no avail, it still did not work. I am trying to interact with a RGB TCS34725 color sensor. End goal is to power a small car, and try and keep it inside the lines. One thing I am noticing is when I use the wrong address I do not even get a error ack back, the ack is always '0'. So I think it has to do with the i2c bus, and not the code because if I am not interpreting the simulation wrong, the SCL and SDA should match I2C protocols/standards. All I am trying to do is read the device ID, once I know I can do that, building the UI will come easily. I appreciate any help that is offered, thank you for your time.
EDIT: Realized I did not set the pull-up resistor to the block diagram. I am now getting a no ack now from Slave, but now I can't get it to send a '0' when I send the correct slave address.
https://pastiebin.com/embed/5cfb27b5a120a <-- Master
https://imgur.com/aZ76pCF <--- Block Diagram
https://imgur.com/8nqwfJh <-- Pin editor
https://imgur.com/bHPApTf <-- Simulation
Right now I have a master that was based off of Pedroni's i2c generic master from Finite State Machines, originally I had SDA <= 'Z' in the states I needed and then assigned SDA <= '1' or '0' for commands/addresses. This did not work unfortunately. So I did some reading and read that to incorporate a proper open drain I should do SDA <= '0' when <condition> else 'Z'. So I did this instead; still nothing. Then I tried to do a weak pull-up resistor too, but to no avail, it still did not work. I am trying to interact with a RGB TCS34725 color sensor. End goal is to power a small car, and try and keep it inside the lines. One thing I am noticing is when I use the wrong address I do not even get a error ack back, the ack is always '0'. So I think it has to do with the i2c bus, and not the code because if I am not interpreting the simulation wrong, the SCL and SDA should match I2C protocols/standards. All I am trying to do is read the device ID, once I know I can do that, building the UI will come easily. I appreciate any help that is offered, thank you for your time.
EDIT: Realized I did not set the pull-up resistor to the block diagram. I am now getting a no ack now from Slave, but now I can't get it to send a '0' when I send the correct slave address.
Last edited: