I have IDF Version: v5.0.6 ...
On another computer I have 5.31 and it's compiling and running there.
I'm now trying to read data from the my IMU
ESP32 read I2C speed increase
-
- Valued Contributor
- Posts: 957
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 186 times
- Been thanked: 210 times
-
- Valued Contributor
- Posts: 957
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 186 times
- Been thanked: 210 times
Re: ESP32 read I2C speed increase
Hi Martin
Yes, it has improved,
but there is something extra at the end. I'll see what it is.
Do I have to start with FCD_ in the variables and take the definition out of the loop and put the variable definition at the beginning of the main?
It is very nice that I can set the clock to 1.2Mega
I assume that reading now only takes 120uSec, maybe a bit tight if I have to sample with 8Khz:)
Do you know how I can test this?
Yes, it has improved,
but there is something extra at the end. I'll see what it is.
Do I have to start with FCD_ in the variables and take the definition out of the loop and put the variable definition at the beginning of the main?
It is very nice that I can set the clock to 1.2Mega
I assume that reading now only takes 120uSec, maybe a bit tight if I have to sample with 8Khz:)
Do you know how I can test this?
polling mode can help to reduce your 50 µs pause because it avoids the overhead of interrupts. If you want to test it, try portMAX_DELAY as timeout for i2c_master_cmd_begin()
-
- Valued Contributor
- Posts: 1401
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 129 times
- Been thanked: 692 times
Re: ESP32 read I2C speed increase
Yes - it sort of trades the delay at the beginning for one at the end.. A little quicker though..
Could use FC variables - local start with FCL_ global with FCV_ (capitalised name too)
Martin
Could use FC variables - local start with FCL_ global with FCV_ (capitalised name too)
Martin
-
- Valued Contributor
- Posts: 957
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 186 times
- Been thanked: 210 times
Re: ESP32 read I2C speed increase
Hi Martin
I have additional measurements with FC10 and a PIC32 and with an ESP32 but with a Python compiler.
So Flowcode seems to work well.
I guess it's time to look at I3C
From a microchip PIC32MZ2048 and FC10, with two breaks: From an ESP32 and Python compiler, mega long long time break...
I have additional measurements with FC10 and a PIC32 and with an ESP32 but with a Python compiler.
So Flowcode seems to work well.
I guess it's time to look at I3C
From a microchip PIC32MZ2048 and FC10, with two breaks: From an ESP32 and Python compiler, mega long long time break...

-
- Valued Contributor
- Posts: 1401
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 129 times
- Been thanked: 692 times
Re: ESP32 read I2C speed increase
It is odd isn't it...
Is maybe an issue with the transactional nature of i2c (I suspect none of the above support direct control of the i2c using Start, Stop etc - but it might be fun to try a chip that does)
Is there an SPI version??
Martin
Is maybe an issue with the transactional nature of i2c (I suspect none of the above support direct control of the i2c using Start, Stop etc - but it might be fun to try a chip that does)
Is there an SPI version??
Martin
-
- Valued Contributor
- Posts: 957
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 186 times
- Been thanked: 210 times
Re: ESP32 read I2C speed increase
I'm still looking at an STM32F405
Yes I have a spi version of the chip
Yes I have a spi version of the chip
-
- Valued Contributor
- Posts: 957
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 186 times
- Been thanked: 210 times
Re: ESP32 read I2C speed increase
Hi Martin
Yes Accelero and Gyro can be used with 8kHz.
A problem is the size from the spi version, I2C is much smaler
and the I2C version is reaydy to use with I3C.
So I test first with the spi version an hope I3C with Flowcode will follow soon.
I will simply change the component Gyro_L3GD20 ( spi)
Size from both:
Yes Accelero and Gyro can be used with 8kHz.
A problem is the size from the spi version, I2C is much smaler
and the I2C version is reaydy to use with I3C.
So I test first with the spi version an hope I3C with Flowcode will follow soon.
I will simply change the component Gyro_L3GD20 ( spi)
Size from both: