I want to minimize current consumption by switching from NORMAL to Low Power Mode 1 and to detect no-motion simultaneously.
That works. But when I'm trying to move BMA280 continually, no-motion interrupt is fired despite the fact that motion does persist. Tested with sleep_dur 0.5ms, 500ms, 1s. In NORMAL mode I see no interrupts by moving the device, and I do see no-motion interrupt when BMA280 is motionless.
Is that expected behaviour? Can I use no-motion & LPM1 together or not?
Solved! Go to Solution.
There is a problem in 0x07 -> INT_RST_LATCH // latched interrupt. When there is no motion for 15s, INT2 pin will go high. Because you latched the interrupt, it will never go low again when you tap the BMA280 continuously. So please try 0x00 -> INT_RST_LATCH // latched interrupt. I have verified your settings on my evakl. board. The INT2 pin no motion interrupt works fine in both normal mode and LPM1 mode with 1s sleep duration.
Still no luck. Even with 0x00 -> INT_RST_LATCH. Tested on two boards (one with I2C, another with SPI). There is continuous motion, but no-motion interrupt IS FIRED after 15s in LPM1 (this issue IS NOT SEEN IN NORMAL MODE). And motion shouldn't cause no-motion interrupt (or not?)
Can I, please, obtain Your functional LPM1+no motion setup (content of ALL 64 BMA280 registers)?
There is 0x0E in PMU_BW (500Hz), but default value after softreset is 2000Hz (my setup + INT_RST_LATCH set to 0x00). But transition from 2000 to 500Hz doesn't change anything on my side.
"I gently tap the board INT2 pin signal goes low."
But I do not see any changes in g in plot (red = 1.000/probably z, green = 0.000/probably x and y)
do strongly tap continuously and observe INT2 (plot with changes in g will be helpful), if it goes high or not (my goes high by tapping and this is undesired - system falls to sleep inadvertently)
Again and again: problems are only in LPM1, NORMAL mode is OK (i.e. no no-motion interrupt when tapping).
I see the same issue with BMA250E and LPM1
Can You, please, provide source code with exact steps in right order, how to fully set BMA280 to LPM1 with no-motion interrupt enabled?
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 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)