Read pedometer

By ruichenspirotr… , 26 May 2025

Hi,

I am attempting to use the pedometer function in the ICM-42670-P but all I can read is 0. The communication works and I can read raw acclerometer and gyroscope data.

This is pseudocode for the commands I send/read to the device. The register names are consistent with the names on the datasheet.

check(i2cRead(MCLK_RDY) == 0x01) // check that OTP is loaded and clock is running
check(i2cRead(WHO_AM_I) == 0x67) // check communication by reading who am i
i2cWrite(ICM42670_REG_PWR_MGMT0, 0b00001111) // put accelerometer and gyroscope in low noise mode
waitMs(10) // wait at least 200 ms after setting ICM42670_REG_PWR_MGMT0
check(i2cRead(ACCEL_CONFIG0) == 0x06) // check that accelerometer config has default values to ensure ODR is 800 Hz (higher than DMP ODR)
i2cWrite(APEX_CONFIG1, 0x0a) // Enable pedometer and set DMP ODR to 50 Hz
numberOfSteps = i2cRead(APEX_DATA1) << 8 | i2cRead(APEX_DATA0);
print(numberOFSteps)

However, numberOfSteps is always 0. What I am doing wrong?

Thanks!

phpbb Topic ID
51036