ICM20948 reading magnetometer data into FIFO.

By ivancenovrndbg , 11 August 2023

Hello,
I am new to this chip, ICM20948. I managed to store accelerometer and gyroscope data into FIFO. Also I set an interrupt on watermark threshold crossing. This works and I can read the raw data (I do not use DMP). However I have troubles storing data from the magnetometer (AK09916) into FIFO alongside with the data of the accelerometer and the gyroscope.

I have setup I2C master I2C_SLV0 to be the magnetometer (AK09916). Also, before trying FIFO, I had successfully poled the magnetometer and had read real data from it.

Now I am trying to store all (3 axes x 2 bytes) x 3 sensors = 18 bytes in FIFO. For first two sensors their data is stored successfuly. However AK09916 datasheet states that 8 bytes must be read beginning from HXL up to ST2. Does this mean that FIFO will contain two bytes per sensors sample wasted? Is this right strategy to fill FIFO?

I have setup following setup for magnetometer:

REG_I2C_SLV0_ADDR = 0x80 | 0x0c;
REG_I2C_SLV0_REG = AK09916_HXL; // 0x11u
REG_I2C_SLV0_CTRL = I2C_SLV0_EN | 0x08u;

I will be thankful for any comments here.
Regards,
Ivan

mustafayildiri…

2 years 7 months ago

Hi,

Are you using the eMD driver that is on the website?

phpbb Post ID
45142
phpbb Topic ID
45123