-
Notifications
You must be signed in to change notification settings - Fork 131
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
3WIRE clock is not correct. #111
Comments
thank you very much sir for your invaluable code! @ALL |
3-WIRE mode involves additional arithmetic and an additional read operation in between clock cycles. This slows down the software and it's effect is not accounted for when specifying the delay parameter to bp_delay_us(). This is why you are seeing a speed reduction at 100kHz, and 400kHz (remember that at 400kHz, the software does not introduce any delay, and for I2C mode, the max speed achievable was 240kHz (#23), whereas for 3-wire it is only 170kHz. Based on calculations, the extra delay for the read (performs a function call) and arithmetic operation is about 2us (1/80kHz - 1/100kHz). 2us is about 32 instruction cycles at 16MIPS. 32 instruction cycles is what we would expect for the extra read operation and arithmetic logic for 3-WIRE. |
Thank you sir for the very useful explanations you provided, now the matter is much more understandable. |
By testing 3WIRE protocol with the new firmware U_1-28102018 I built (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498&start=105#p67796) I found the same issues as for I2C SOFTWARE protocol.
By choosing ~5KHz, ~50KHz or ~100KHz, does not matter what of them, the 3WIRE clock is alway about ~700Hz, while by choosing ~400KHz it is about ~200kHz that is the half of the value set.
#23
#39
The text was updated successfully, but these errors were encountered: