Hello Team,
I have an application where I want to use ICM-42670P wake on motion interrupt. I have attached and configured wake on motion interrupt as per application note but I am not getting any pulse over the interrupt pin INT1 (checked with oscilloscope as well). Can you confirm what might be the issue ? Below is my code which I have tried.
Note : I am using nrf52832 controller.
uint32_t app_mpu_int_enable(void)
{
uint32_t err_code;
err_code = nrf_drv_mpu_write_single_register(INT_CONFIG, 0x03);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(INT_SOURCE0, 0x18);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(INT_SOURCE1, 0x07);
if(err_code != NRF_SUCCESS) return err_code;
nrf_delay_ms(1);
err_code = nrf_drv_mpu_write_single_register(BLK_SEL_W, 0x00);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(MADDR_W, 0x4B);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(M_W, 0x50);
if(err_code != NRF_SUCCESS) return err_code;
nrf_delay_us(10);
err_code = nrf_drv_mpu_write_single_register(MADDR_W, 0x4C);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(M_W, 0x50);
if(err_code != NRF_SUCCESS) return err_code;
nrf_delay_us(10);
err_code = nrf_drv_mpu_write_single_register(MADDR_W, 0x4D);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(M_W, 0x50);
if(err_code != NRF_SUCCESS) return err_code;
nrf_delay_us(10);
nrf_delay_ms(1);
err_code = nrf_drv_mpu_write_single_register(WOM_CONFIG, 0x06);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(WOM_CONFIG, 0x07);
if(err_code != NRF_SUCCESS) return err_code;
return NRF_SUCCESS;
}
uint32_t app_mpu_init(void)
{
uint32_t err_code;
uint8_t data;
// Initate TWI or SPI driver dependent on what is defined from the project
err_code = nrf_drv_mpu_init();
if(err_code != NRF_SUCCESS) return err_code;
data = readRegister(WHO_AM_I);
NRF_LOG_INFO("0X%02X ", data);
data = readRegister(MCLK_RDY);
NRF_LOG_INFO("0X%02X ", data);
err_code = nrf_drv_mpu_write_single_register(SIGNAL_PATH_RESET, 0x10);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(PWR_MGMT0, 0x02);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(ACCEL_CONFIG1, 0x01);
if(err_code != NRF_SUCCESS) return err_code;
err_code = nrf_drv_mpu_write_single_register(ACCEL_CONFIG0, 0x0A);
if(err_code != NRF_SUCCESS) return err_code;
return NRF_SUCCESS;
}
I have tried with open drain and push-pull both settings but still not able to get any interrupt over INT1 pin.
Please let me know as this is an urgent request. As we have a large order qty for this 100K by 2025.
Thank for understanding and please let me know if any further information required.
Any update regarding this issue?
Hello,
Unfortunately, I can't help with debugging your code. However, we have this application note explaining how to set up APEX Motion Functions: https://invensense.tdk.com/wp-content/uploads/2023/05/an-000271-icm-42607x-icm-42670x-apex-motion-functions-description-and-usage.pdf
Also, you take peak at our eMD firmware on Microchip Studio to see how we set it up: https://invensense.tdk.com/developers/software-downloads/#smartmotion
Hello Mustafa,
Here in the application note it does not mention which Int pin the interrupt is being generated or the interrupt pin configuration. Can you help with that? As I have followed all the steps for wake on motion activity but still not getting anything over interrupt pin 1.
Hi,
Why are you setting this?
err_code = nrf_drv_mpu_write_single_register(INT_SOURCE0, 0x18);
if(err_code != NRF_SUCCESS) return err_code;
Also, did you try reading the INT_STATUS2?