For: ESP-IDF v3.3
I want to configure a low I2C clock speed of 1K because I want to use the ESP32 in combination with a few slave devices using a relatively long cable of 1 meter. I cannot use another data protocol in this project.
The ESP-IDF docs do not specify a lowest I2C clock speed so I assumed that a low speed of for example 1K would be possible.
I have implemented the usual things such as using a 0.34mm2 3x twisted pair SCL+VCC SDA+GND VCC+GND cable; and specific pullups for SCL and SDA on both ends of the cable. And it works fine for a cable of 0.75 meter and 1.25 meter. However I noticed that the lowest possible clock speed using EDP-IDF seems to be 5K; even when specifying lower vales such as 1K.
So I ran a few tests using a logic analyzer. The lowest possible speed seems to be 5K. And the actual clock speed is inconsistent when specifying values lower than 5K:
Code: Select all
Test using separate short 10 centimer wires for VCC GND SCL SDA.
STATUS CLK_SPEED SCLMeasuredSpeed
=======================================
Error 50 2924 !
Error 100 5800 !
Error 1000 5511 !
Error 2000 10000 !
Ok 4000 3989
Ok 5000 4983
Ok 20000 19750
Ok 100000 94120
Ok 400000 320000
Thanks,
Paul.