What is the lowest supported I2C clock speed?

papaluna
Posts: 50
Joined: Tue Jan 30, 2018 11:27 am

What is the lowest supported I2C clock speed?

Postby papaluna » Tue Nov 05, 2019 10:36 pm

Hi,
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
Can someone confirm that 5K is indeed the lowest possible speed? Or am I doing something wrong?

Thanks,
Paul.
Last edited by papaluna on Fri Nov 08, 2019 2:25 pm, edited 1 time in total.
--
Paul.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: What is the lowest supported I2C clock speed?

Postby WiFive » Wed Nov 06, 2019 2:38 am

Theoretically ~2.5k but the driver may not be able to calculate the values correctly

papaluna
Posts: 50
Joined: Tue Jan 30, 2018 11:27 am

Re: What is the lowest supported I2C clock speed?

Postby papaluna » Wed Nov 06, 2019 4:18 pm

Thanks.

Should I create a github issue for the driver and how it calculates the clk_speed?
--
Paul.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: What is the lowest supported I2C clock speed?

Postby WiFive » Thu Nov 07, 2019 1:49 am

Sure

papaluna
Posts: 50
Joined: Tue Jan 30, 2018 11:27 am

Re: What is the lowest supported I2C clock speed?

Postby papaluna » Thu Nov 07, 2019 10:46 pm

--
Paul.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], dzungpv and 79 guests