Open andreireanu opened 4 years ago
Check that your logic analyzer measures periods correctly. I had similar problems with another FX2-based LA that lied to me.
Thanks for the reply! The thing is I used a different library at some point (pyftdi) and the real frequency was recorded correctly by the analyser, so I don't think there's an issue with it.
Oh, interesting. By the way, on your screenshot i observe clock blanks being twice as long as the pulses; is it the same with pyftdi?
Nope, the blanks were the same size as the ones.
I seem to have found the problem:
To make I2C working, FTDI needs to enable what they call a "3 phase clock". PyFtdi implements this feature. The issue with this mode is that it requires 3 clock phase for each clock period, hence the 2:3 ratio. PyFtdi hides this setting from the user, and silently tweaks the specified clock to match what the users expects. libmpsse seems not to do it.
Is anyone aware of the inner working of the libmpsse library and how I could make this change to it? Thanks!
On Thu, Apr 09, 2020 at 05:25:21AM -0700, Andrei Ungureanu wrote:
Is anyone aware of the inner working of the libmpsse library and how I could make this change to it? Thanks!
Check build_block_buffer()
-- () ascii ribbon campaign - against html mail /\ http://arc.pasp.de/ - against proprietary attachments
Also i see it being enabled in SetMode().
Can you please be more specific on where I can find this part of code? I searched for the definitions of the frequency constants and this led me to the compiled _pylibmpsse.so file.
Hello, I'm having a bit of trouble setting the clock frequency. For example if I create the I2C object using a 2 MHz frequency (TWO_MHZ parameter), the real observed frequency is 1,33 MHz. This ratio appears no matter the frequency I set, the real frequency is always 2/3 out of the frequency I set. Any reason for this?