Hi,
Please see the attached screenshot again. I changed the no motion duration to 2s in order to capture the screenshot. I continuously tap the board and there are pulses on INT2 pin. This is because BMA280 takes measurement at every 1s in LPM1 due to the 1s sleep time. If the motion happens exactly at the time point of 2s no motion duration expires, then INT2 pin will keep low meaning that the motion is still there. Otherwise, INT2 goes high. Because I continuously tap the board, INT2 goes low quickly due to the motion detected.
BMA280_no_motion_INT2_LPM1_1s_sleep_and 2s_duration
BMA280 default ODR is 2000Hz for unfiltered data. You need to write value of 0x0E to register 0x10 to change the ODR to 1000Hz which is 500Hz BW. When you write value of 0x5E to register 0x11, BMA280 enters LPM1 mode with 1s sleep time. If you want to have similar no motion interrupt performance like normal mode, then you can write value of 0x56 to register 0x11 to have 25ms sleep time in LPM1.
Below is the pseudo code:
Write value of 0xB6 to register 0x14; // soft-reset
Delay 5ms; // wait for BMA280 to stabilize
Write value of 0x04 to register 0x20; // set INT2 pin to push-pull and active-high
Write value of 0x0A to register 0x29; // set no motion threshold to 39mg at +/-2g full scale range
Write value of 0x04 to register 0x27; // set no motion duration to 2s
Write value of 0x00 to register 0x21; // set INT2 as non-latched
Write value of 0x08 to register 0x1B; // map no motion interrupt to INT2 pin
Write value of 0x0F to register 0x18; // select no motion and enable x/y/z axes for no motion
Write value of 0x5E to register 0x11; // set BMA280 to LPM1 mode with 1s sleep time (need to change to 25ms sleep time)
Thanks.
... View more