ICM-20948 reading quaternion

By leeyatchunsysdtcom , 13 December 2021

Hi everyone

I am currently developing with ICM-20948 motion sensor and I faced some issue about reading quaternion.

What I have done:
My micro controller unit is Renesas RL78/G14 and use I2C to connect to the sensor.
So far I can read the following basic data in 100Hz.
The basic data is
- accelerometer and gyroscope through the register ACCEL_XOUT_H to GYRO_ZOUT_L (Total 12 byte data)
- compass data from ADR_EXT_SLV_SENS_DATA00 to ADR_EXT_SLV_SENS_DATA_05 (Total 6 byte data)

What I am working on:
Now my task is to output the quaternion also in 100Hz.
I have read the data sheet of ICM-20948 and found it did not mentioned anything about quaternion and no much detail about DMP.
After searching on Goole I found an open source on github (https://github.com/ZaneL/Teensy-ICM-20948).
So I integrated the library, writing the DMP3 firmware, and successfull read values from FIFO.

What my problem is:
Although values are coming from FIFO, I found that reading the quaternion from FIFO is quite slow.
By measuring the performance, without reading the quaternion, the basic data can be read in 100Hz as planned.
But when I starts reading the quaternion value, the overall data sampling drops to around 80-82Hz.
So I suspect reading the FIFO is slow.

What I want to ask:
1. Is there any document about how to work with DMP? The data sheet does not mention a lot.
E.g. I found the datasheet does not mention Bank 0 0x7D is MEM_R_W but it is on the github sample code.

2. Is there any problem if I connect with I2C instead of SPI?
I found someone said it is better to connect with SPI.

3. Is there any document explaining the FIFO output?
Altough the sample code helps me extract the FIFO output to Quaternion.
I would like to know more about the value inside the FIFO.

4. My current setting to DMP are as follow:
enable_gyroscope = false;
enable_accelerometer = false;
enable_magnetometer = true;
enable_quaternion = true;
gyroscope_frequency = 1;
accelerometer_frequency = 1;
magnetometer_frequency = 1;
quaternion_frequency = 100;
So what data are coming from FIFO and how many bytes are they?
I guess every 1 second, 1 sample of magnetometer and 100 sample of quaternion data?

Thank you very much.
Joe

phpbb Topic ID
39258