12-23-2019 01:25 PM
Hello
I'm working on integrating the no-motion interrupt on BMI160 in an Android environment. The sensor is connected and running already, and the no-motion interrupt has been configured on INT1 with duration, and threshold. It is firing as expected.
However, the interrupt needs to be controllable on/off from the Android UI. This is working as intended as well - almost.
After having configured the interrupt off (INT_MAP_0, bit 3) the interrupt is not firing any more. However, when I enable the interrupt again and read the status bit (INT_STATUS_0, bit 7) it is immediately "1". I am expecting it to be "0".
Reviewing the datasheet:
"Register (0x1C-0x1F) INT_STATUS
Each flag is associated with a specific interrupt function. It is set when the associated interrupt
triggers. The setting of <3:0> controls if the interrupt signal and hence the respective interrupt
flag will be permanently latched, temporarily latched or not latched. The interrupt function
associated with a specific status flag must be enabled."
Have I misunderstood the datasheet? How do I ensure that the status bit is not written after having disabled the interrupt?
Solved! Go to Solution.
12-23-2019 01:31 PM
To clarify.
When I disable the interrupt (INT_MAP_0, bit 3) _I also disable the three axes (INT_EN_2, bits 0,1,2).
01-02-2020 09:58 AM
Hi agoransson,
I am not sure if it was a typo in your post, but INT_STATUS_0, bit 7 is the flat_int flag and not the nomo_int flag. That would be INT_STATUS_1, bit 7.
The INT_MAP registers only 'connect' the interrupt engine to the interrupt pin. In order to disable an interrupt, the INT_EN registers will need to be used as you have already mentioned. What is the order of configuration for enabling and disabling the interrupt?
While enabling it is recommended that you first connect/disconnect using INT_MAP registers and then configure the INT_EN registers to enable/disable the required interrupt.
While disabling it is recommended that you first configure the INT_EN registers to enable/disable the required interrupt and then the connect/disconnect using INT_MAP registers.
Regards,
kgoveas
01-13-2020 02:34 PM
Yes, that was a typo. I meant to write STATUS_1.
What worked for me was to run the interrupt reset cmd (0xB1) every time the no-motion was triggered. That seems to do the trick.
I was also doing it the opposite order, EN then MAP. I will change that.
Thanks.