-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rtl] TWD idle when NoACK during reading #1158
Conversation
Explanation: this prevents the MSB to pull the SDA line down and thus preventing the stop command to be recognized. |
Ah I see. So we should also check for a STOP condition in the ACK time slot? Shouldn't we do this for read and write accesses? |
if (ctrl.enable = '0') then -- disabled? | ||
if ( | ||
(ctrl.enable = '0') or -- disabled? | ||
((engine.cmd = '1') and (smp.scl_rise = '1') and (smp.sda = '1') ) -- or no ACK while read? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, cou are checking for a STOP condition here, right?
Can't we use the smp.stop
signal?
((engine.cmd = '1') and (smp.stop = '1')) -- STOP while read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, as the stop signal is a SDA rise with SCL being one and not the other way around. This is more like reading the 9th bit: is the ack set or not? If not => I'm done (technically waiting for the stop), if yes => I send the next byte.
Something isn't right with the TWD... 🙈 |
I think there are several design flaws in the TWD 🙈 |
Works with #1161, thanks! |
Great to hear and thanks for the feedback! |
Fixes #1157 and to my understanding should be TWI compliant.