05-28-2020 04:59 PM
Hi,
I'm designing a battery powered device wit BMA280. So, I hope to use Low power modes with FIFO.
The operation sequence I'm testing is like this.
1. Constantly monitoring vibration in LPM1. In this time, slope interrupt is mapped interrupt pin1.
2. If some movement is detected, disables interrupt 1 and starts using FIFO with a equidistance mode.
In this time, changes mode to LPM2 to get data from FIFO_DATA (0x3F) and enables watermark interrupt mapped to interrupt pin2.
Actually, I set to Normal mode before going LPM2 from LPM1.
3. Fetching data from Fifo for a while.
4. After then, goes back to LPM1 again, enables interrupt 1, and disable interrupt 2.
But, unfortunately, I found that Fifo is not filled when I change mode from LPM1 to Normal in step 2 above.
The only way I can make queue operation again is applying softreset.
If I block codes to change modes, it correctly fills FIFO and invokes watermark interrupt (pin2)
Am I using BMA280 correctly? Is there any command to run FiFo filling operation while I'm changing modes?
Thanks,
Solved! Go to Solution.
05-28-2020 07:06 PM
Hi,
Thanks for your inquiry.
If you want to record BMA280 x/y/z data into FIFO in STEAM mode with EST mode in LPM1, then you could try the following in your step 2:
(1)Disable INT1 for slope interrupt
(2) Switch to Standby mode
(3) Write value of 0x8C to register 0x3E to clear FIFO buffer
(4) Set FIFO watermark level and enable FIFO watermark interrupt and map it to INT2 pin
(5) Switch to LPM1 mode and then FIFO will start filling data
(6) Wait for INT2 pin interrupt for FIFO watermark interrupt
(7) After INT2 interrupt is generated, disable INT2 and switch to normal mode and fetch FIFO data
(8) Switch to LPM1 and enable INT1 for slope interrupt
(9) After INT1 is generated again, go back to (1)
Please let us know how it goes.
Thanks.
05-29-2020 05:19 PM
Thank you,
The reason I didn't try the way was I coun't sure of the timing.
I attached a figure. Please look at for a while.
I hope to get samples in equistance timing.
Is the internal timer in BMA280 keeps the timing
while we change to normal mode, fetch data, and re-entering LPM1 mode?
For example, in my figure the time distance btw 4th and 5th samples.
If it keeps timing regardless of changing modes, I'll be very happy.
I'll use this way.
If it is not, the I guess I have to use LPM2 mode for reading Q data.
Currently I don't know how to change a mode from LPM1 --> normal --> LPM2, without softreset.
05-29-2020 05:22 PM
Can you see the attached figure?
I attached the fiure. But, I think it is not displayed.
Here I did it again.
If
06-03-2020 05:19 PM
Hi,
BMA280 will not be able to keep the timing when you switch to normal mode (NM) from LPM1 and then go back to LPM1 for the FIFO. If you get the slope interrupt in LPM1 mode, then you can switch to LPM2 mode and use EST mode so that FIFO data will keep the timing like the way you expected.
After power on or soft-reset BMA280 will be in NM mode at 500Hz BW or 1000Hz ODR by default. It consumes about 130uA. You can then write value of 0x0F to register 0x10 to set the ODR to 2000Hz. Suppose you use 25ms sleep time for LPM1 and LMP2. After you write value of 0x56 to register 0x11, BMA280 will enter LPM1 and consumes about 6.5uA.
Below is the pseudo code to enter LPM2 from LPM1.
(1) Write value of 0x16 to register 0x11; // this will clear the lowpower_en bit and BMA280 will enter NM with about 130uA current consumption
(2) Write value of 0x60 to register 0x12; // this will set the lowpower_mode bit to be prepared to enter LPM2. EST mode is enabled
(3) Write value of 0x56 to register 0x11; // this will make BMA280 enter LPM2 with about 60uA current consumption
Below is the pseudo code to enter LPM1 from LPM2.
(1) Write value of 0x16 to register 0x11; // this will clear the lowpower_en bit and BMA280 will enter NM with about 130uA current consumption
(2) Write value of 0x40 to register 0x12; // this will clear the lowpower_mode bit to be prepared to enter LPM1. EST mode is enabled
(3) Write value of 0x56 to register 0x11; // this will make BMA280 enter LPM1 with about 6.5uA current consumption
Thanks.