ICM42688 set devıce offsets on the fly

By altinellergmailcom , 4 October 2023

Hello,

I have succeeded settıng the gyro and acceletometer offsets, by using USER PROGRAMMABLE OFFSET that is referenced in datasheet section 5.4.

The routine I created works but only before device bootup. If the device offsets are changed while the sensor is running, it is not taken into effect.

Namely, I have the following init procedure:

setDeviceOffsets(wx, wy, wz, ax, ay, az); // set device offsets to 0
bool accel_ok = setAccelODRAndFSR(ODR_100HZ, FSR_0); // set accel odr: 1Khz, fsr: ±16g
bool gyro_ok = setGyroODRAndFSR(ODR_100HZ, FSR_0); // set gyro, odr: 1Khz, fsr: ±2000dps
if(!(accel_ok & gyro_ok)) { nogo(); } // if parameter fail, nogo
startFIFOMode(); // start fifo mode
startTempMeasure(); // start temp measure
startGyroMeasure(LN_MODE); // start gyro, low-noise mode
startAccelMeasure(LN_MODE); // start accel, low-noise mode

I can adjust device offsets and it works just fine, but only if device offsets are written to the USER PROGRAMMABLE OFFSET.

Is there a way, or workwaround so we can change the device offsets while the sensor is operating?

Any ideas/recomendations/help greatly appreciated.

-C.A.

mustafayildiri…

2 years 5 months ago

Hi,

Are you trying to transition from Low Noise mode to Low Power mode on the fly? Please take a look at the Section 12 and 14.36 (PWR_MGMT0).

phpbb Post ID
45259

altinellergmailcom

2 years 5 months ago

Thank you,

I am trying to change gyro/accel offsets on the fly. It seem that section 12 has all the missing information I need.

Best Regards,
Can

phpbb Post ID
45267

mustafayildiri…

2 years 5 months ago

Let us know if you have more questions.

phpbb Post ID
45272
phpbb Topic ID
45254