Quote:
Originally Posted by Mike Bortfeldt
Joe,
Could you explain exactly what SetCompatabilityMode does? That corrected a sporatic communication issue I had with an Arduino as well and I would like to understand why. The documentation is, shall we say, sketchy.
Thanks,
Mike
|
Hi Mike,
The Digital I/O from the 9403 module is registered... meaning it takes several clock cycles in the FPGA for a digital write to be read back in. When using I2C over an interface like this, that means that the checking for clock skewing is expensive time-wise. As a result, the I2C implementation in the FPGA attempts to optimize this by only checking for clock skewing in "typical" parts of the waveform. Of course in the I2C spec, devices are allowed to skew the clock almost anywhere. The compatibility mode checks for clock skewing everywhere required by the spec and is thus "compatible" with that spec. The result is that your I2C transfer speed is slower (if I recall transactions take approx 60% longer), but you can talk to any I2C device, not just "typical sensors".
I hope this clears up any gaps in the documentation (are you talking about WPILibJ doxygen?).
Cheers,
-Joe