OpenCores
no use no use 1/1 no use no use
I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by cyy0825 on Jun 28, 2014
cyy0825
Posts: 3
Joined: Apr 23, 2014
Last seen: Sep 3, 2014
Dear All,

I am trying to understand Richard Herveille's I2C Master Core verilog code.
In i2c_master_bit_ctrl.v, at around line 306, when he detects the start and stop condition,
he uses the code

sta_condition detect falling edge on SDA while SCL is high
sto_condition detect rising edge on SDA while SCL is high

Is there any problem with this code? It seems that the first one is detecting the rising edge and second one is detecting the falling edge, is it wrong?
RE: I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by rherveille on Jul 30, 2014
rherveille
Posts: 33
Joined: Sep 25, 2001
Last seen: May 31, 2018
This is the correct and intended behaviour.
Read the i2c specifications.

Richard
RE: I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by cyy0825 on Aug 7, 2014
cyy0825
Posts: 3
Joined: Apr 23, 2014
Last seen: Sep 3, 2014
This is the correct and intended behaviour.
Read the i2c specifications.

Richard


Hey Richard,

Thanks for your reply.
One thing I can't understand is that, in the code it said:
sta_condition
If sSCL is high, then to generate a start condition, sSDA should be low and dSDA should be high, then is it a rising edge instead of falling edge?
RE: I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by cyy0825 on Aug 7, 2014
cyy0825
Posts: 3
Joined: Apr 23, 2014
Last seen: Sep 3, 2014
This is the correct and intended behaviour.
Read the i2c specifications.

Richard


It seems that the right hand side of the equation can't show up, I don't know why.
I will look through the code by myself again to see if I can understand it, but if you can give me a hand, that will be a lot help.

Thanks
RE: I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by rherveille on Aug 8, 2014
rherveille
Posts: 33
Joined: Sep 25, 2001
Last seen: May 31, 2018
to detect an edge you use the current and the previous value.
If the previous (delayed) value is a '1' and the current value is a '0', then it's a falling edge.
If the previous (delayed) value is a '0' and the current value is a '1', then it's a rising edge.

Richard
RE: I2C Core Problem -- Any one using Richard Herveille's I2C Master Core?
by bilal2228 on May 22, 2017
bilal2228
Posts: 7
Joined: May 17, 2017
Last seen: Feb 26, 2019
hello sir,
i am beginner and trying to simulate you code can you help how to set values after start running to get result as mentioned in the document example
regards
no use no use 1/1 no use no use
© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.