ESP32 ICM426XX driver

User avatar
Vader_Mester
Posts: 300
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

ESP32 ICM426XX driver

Postby Vader_Mester » Mon Jun 07, 2021 5:13 am

Hi Guys,

I have ported the InvenSense's official driver to the ESP-IDF platform, for ICM426XX 6-axis motion sensors.
The port is not 100% yet, as there is a pre-built lib that needs to be integrated, but other than that, it works nicely.

https://github.com/VaderMester/ESP32-ICM426XX-driver

I made it so that you can easily plug in your SPI or I2C drivers, as it is not tied to the driver itself.

At the moment only reading from FIFO is made to work using interrupts.

So far, I only was able to test this with an ICM42605, which is one of the cheapest one, but with a good feature set.
I'll use that as a substitute for the MPU6050.

Some things that needs implementation, and in the works:
- Usage of DMP features like Apex, Tilt detection, Significant Motion detection, pedometer, etc.
- Making functions to configure internal hardware filters of the device.
- Calibration and self test so that output is properly zerod, and storing calibration values into NVS.
- Raw data readout without using FIFO.

Footnote: One remark of the InvenSense prebuilt lib, is that InvenSense was kind enough to pre-build it for me with IDF.
Hopefully it'll work, once integration is complete.
There is a handly .exe file for Windows provided by InvenSense, and an example that uses this pre-built lib, which supposed to communitcate with via a COM port through UART, and it visualizes motion sensor data. I hope I can make that work as well.

If you have any questions, feel free to ask below.

Regards,
Vader(Ben)

Code: Select all

task_t coffeeTask()
{
	while(atWork){
		if(!xStreamBufferIsEmpty(mug)){
			coffeeDrink(mug);
		} else {
			xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
			xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
		}
	}
	vTaskDelete(NULL);
}

edo76mal
Posts: 7
Joined: Wed May 11, 2022 10:17 am

Re: ESP32 ICM426XX driver

Postby edo76mal » Fri Mar 01, 2024 5:09 pm

Hi Vader_mester.

I'm trying to use your library for ICM42605. My target is to use esp32 (with visual studio 2022 and visualgdb, esp idf 5.1) and icm42605 at the highest rate i.e 8kHz for accel and gyro in order to analize slow movements. At the moment I don't succeed in using fifo (using your example) either register data. I found your post on use of interrupts. I have some questions (please forgive me for my ignorance):
1) I need to link pint int1 to pin gpio1 on eps32? (I don't see any difference if linked or not)
2) Can I read registers on interrupt?


Did you succeed in using interrupts? Can you help me?

Fityourselflab
Posts: 1
Joined: Fri Mar 01, 2024 6:08 pm

Re: ESP32 ICM426XX driver

Postby Fityourselflab » Fri Mar 01, 2024 6:10 pm

Hi.

I'm trying to use your library for ICM42605. My target is to use esp32 (with visual studio 2022 and visualgdb, esp idf 5.1) and icm42605 at the highest rate i.e 8kHz for accel and gyro in order to analize slow movements. At the moment I don't succeed in using fifo (using your example) either register data. I found your post on use of interrupts. I have some questions (please forgive me for my ignorance):
1) I need to link pint int1 to pin gpio1 on eps32? (I don't see any difference if linked or not)
2) Can I read registers on interrupt?


Did you succeed in using interrupts? Can you help me?

Who is online

Users browsing this forum: No registered users and 57 guests