10-14-2020 05:27 PM
Hello,
I've been working on BMA400 (on accel 5 click board) for some time and been able to map each generic interrupt to the both pins.
Now I'm working on automating things as discussed here, and configured the BMA400 based on the document as mod FAE_CA1 shared in Auto low power and auto wake up .
But somehow the wake-up sequence does not fire, and i cannot see the hardware interrupt (at the oscilloscope) as shown in the document.
Here is my configuration pseudo-code,
write 0x02 => 0x19 (ACC_CONFIG0.power_mode.b10) // NORMAL MODE
write 0x04 => 0x1F (INT_CONFIG0.gen1_int_en) // GEN1 INTERRUPT ENABLE
write 0x80 => 0x20 (INT_CONFIG1.latch_int.b1) // INTERRUPT LATCHED
write 0x02 => 0x24 (INT12_IO_CTRL.int1_lvl.b1) // INT1 LEVEL HIGH
write 0x02 => 0x2D (AUTOWAKEUP_1.wkup_int.b1) // WKUP INT ENABLE
write 0x01 => 0x21 (INT1_MAP.wkup_int1.b1) // WKUP INT MAPPED TO INT1
write 0xE6 => 0x2F (WKUP_INT_CONFIG0.wkup_z/y/x_en.b1, .num_of_samples.b001, .wkup_refu.b10)
// X/Y/Z ENABLE, NUM OF SAMPLES 2, WAKEUP REFERENCE EVERYTIME, HYSTERESIS NONE
write 0x03 => 0x30 (WKUP_INT_CONFIG1.int_wkup_thres.b00000011) // WKUP INTERRUPT THRESHOLD = 3
write 0x02 => 0x2B (AUTOLOWPOW_1.gen1_int.b1) // GEN1 INTERRUPT TRIGGER AUTO LOW POWER
write 0xF8 => 0x3F (GEN1INT_CONFIG0.gen1_act_z/y/x_en.b1, .gen1_data_src.b1, gen1_act_refu.b10, gen1_act_hyst.b00)
// X/Y/Z ENABLE, DATA SOURCE FILT2, REF UP EVERYTIME, HYSTERESIS NONE
write 0x01 => 0x40 (GEN1INT_CONFIG1.gen1_criterion_sel.b0, .gen1_comb_sel.b1) // CRITERION INACTIVITY, COMBINATION AND
write 0x02 => 0x41 (GEN1INT_CONFIG2.gen1_int_thres.b00000010) // GEN1 INTERRUPT THRESHOLD 2
write 0x00 => 0x42 (GEN1INT_CONFIG3.gen1_int_dur_15_8.b00000000) // GEN1 INTERRUPT DURATION HIGH 0
write 0x64 => 0x43 (GEN1INT_CONFIG31.gen1_int_dur_7_0.b01100100) // GEN1 INTERRUPT DURATION LOW 100
Any help is appreciated.
Thanks
NANA
Solved! Go to Solution.
10-15-2020 06:46 PM
Hi,
Thanks for your inquiry.
I tried your pseudo code on my eval. board and I can see the pulse on INT1 pin when I tap the board to trigger the wakeup interrupt. BMA400 automatically switches from low power mode at 25Hz ODR to normal mode at 200Hz ODR. After a short while stationary BMA400 automatically switches back to low power mode. If you write value of 0x04 to register 0x22 to map Gen1 interrupt to INT2 pin, then you should see the falling edge on INT2 pin as shown in the attached picture because INT2 pin is set to active-low in your pseudo code below.
Thanks.
10-16-2020 08:31 AM
Oh I see.
I saw the spikes as shown as well but I was trying to configure as the document image shows;
I mean wakeup interrupt(INT1 pin) being High as long as a motion exist and after motion stops this high lvl still hangs ~t seconds (1 seconds based on the configuration) and drops low.
Where should i make changes to get the shown image?
Thanks in advance
Nana
10-16-2020 03:40 PM
Hi,
The image shows BMA400 data and interrupt signal by continuously reading data registers and interrupt status registers. Reading interrupt status registers will clear the interrupt signal. So when you see wakeup interrupt you can read register 0x0E. Then the interrupt signal will go low immediately.
Thanks.
10-16-2020 04:24 PM
Hello,
There is the problem actually. Does not matter if i configure latched or non-latched interrupt. The wake-up interrupt i get is like the spikes in your attachment. So there is no stable state for the given amount of time, just spike up or down and interrupt goes-off.
I guess i didn't express myself clearly enough. So my aim is;
write 0x02 => 0x19 (ACC_CONFIG0.power_mode.b10) // NORMAL MODE
write 0x04 => 0x1F (INT_CONFIG0.gen1_int_en) // GEN1 INTERRUPT ENABLE
write 0x02 => 0x2D (AUTOWAKEUP_1.wkup_int.b1) // WKUP INT ENABLE
write 0x01 => 0x21 (INT1_MAP.wkup_int1.b1) // WKUP INT MAPPED TO INT1
write 0x02 => 0x2B (AUTOLOWPOW_1.gen1_int.b1) // GEN1 INTERRUPT TRIGGER AUTO LOW POWER
write 0x80 => 0x20 (INT_CONFIG1.latch_int.b1) // INTERRUPT LATCHED
write 0x02 => 0x24 (INT12_IO_CTRL.int1_lvl.b1) // INT1 LEVEL HIGH
write 0x00 => 0x42 (GEN1INT_CONFIG3.gen1_int_dur_15_8.b00000000) // GEN1 INTERRUPT DURATION HIGH 0
write 0x64 => 0x43 (GEN1INT_CONFIG31.gen1_int_dur_7_0.b01100100) // GEN1 INTERRUPT DURATION LOW 100
At least that is what i thought my configuration (the document referring to) is doing.
If I cannot (as it is not possible) program the sensor to work this way, I'll have to make it work in normal mode all the time, because I'd achieved that configuration without any problems. But what i understand from the documents and forum discussions it could be done.
Are there any onther application notes you can direct me maybe? Because I cannot see where the problem is stuck in this state.
Thanks in advance.
Nana