01-06-2021 03:10 PM
Hello,
I'm trying to set up the any motion feature for the BMI270. The sensor is set up correctly and I can read data from the accelerometer and gyroscope. I added the any motion feature to the struct used for the bmi2_set_sensor_config function in the API. There are no errors, but the hardware interrupt never triggers. I tried reading the INT_STATUS_0 register, and it did set the corresponding bit high at some point. But I made some changed since then, and it's not working anymore. I'm not sure how to get to that point again.
I attached the functions used for the sensor configuration. The read/write functions etc. all work as desired.
Thanks in advance 🙂
Paraas
Solved! Go to Solution.
01-06-2021 04:59 PM
Hello paraas,
I think you missed interrupt map. 🙂
I attached my example for any motion feature.
As you also use API, so you can easily apply it.
Please check below functions in my code 🙂
"/* Enable the selected sensors. */
rslt = bmi2_sensor_enable(sens_list, 2, &bmi2_dev);
/* Set feature configurations for any-motion. */
rslt = set_feature_config(&bmi2_dev);
/* Map the feature interrupt for any-motion. */
rslt = bmi2_map_feat_int(&sens_int, 1, &bmi2_dev);
"
Please let me know if you have further questions 🙂
Thank you.
Minhwan Oh
01-07-2021 01:39 PM
Hello again Minhwan,
Thanks for the quick reply. 🙂
I have the bmi2_map_feat_int function at the end of the bmi2_accel_gyro_set_config, which is called in the IMU_init. Are there any functions in the API which can cause a conflict with the mapping function?
I tried uploading your example, but it's not initializiting correctly. Had to change from SPI to I2C communication, since my SPI bus is full with other sensor data. I've attached the modified version of your example, are you willing to check if I've missed something?
Best regard
Paraas
01-14-2021 05:02 AM
Hello paraas,
Could you please let me know when you have some error?
There is rslt value and you can find it where is problem 🙂
Thanks,
08-25-2021 03:25 PM
Hello again,
Sorry I haven't replied until now. We decided not to use the anymotion feature for our design anyways. Thanks for the help 🙂