I program an application, where the BMA is in low power mode, till an threshold is reached. After that, the BMA should read acceleration values, as long, as the interrupt is . The interrupt is only triggered once, when passing the ., so i thought, i read the GEN1triggeredthreshold status-bit and as long at it is set, i read the acceleration data. But the bit is only set to 1 and not reset. Any suggestions ? Here my configuration: //Auto-lowpower relative
setRawRegisterValue(AUTOLOWPOW_1_REG_ADDR, 0b00000010); //Configure Auto low Power when still standing
//Generic interrupt 1 (gen1) relative
setRawRegisterValue(GEN1INT_CONFIG0_REG_ADDR, 0b11111000); //Interrupt Condition: all axes, 100 Hz, auto update, hyst disable
setRawRegisterValue(GEN1INT_CONFIG1_REG_ADDR, 0b00000001); //Interrupt Condition: all axes must be under the threshold
setRawRegisterValue(GEN1INT_CONFIG2_REG_ADDR, 0b00000101); //Interrupt Condition: Set treshold to 5*8mg/lsb = 40mg
setRawRegisterValue(GEN1INT_CONFIG3_REG_ADDR, 0b00000000); //Interrupt Condition: Monitor Duration Cofig3*256+gonfig31 = 100 Samples
setRawRegisterValue(GEN1INT_CONFIG31_REG_ADDR, 0b01100100); //Interrupt Condition: Monitor Duration 100 sample /100Hz = 1s
//Auto-wakeup relative
setRawRegisterValue(AUTOWAKEUP_1_REG_ADDR, 0b00000010); //Configure Auto wakeup to switch from lowpower to normal mode
//Wakeup interrupt relative
setRawRegisterValue(WKUP_INT_CONFIG0_REG_ADDR, 0b11101110); // Interrupt Condition: all Axis; 3/4 Samples; auto update
setRawRegisterValue(WKUP_INT_CONFIG1_REG_ADDR, 0b00000011); // Interrupt Condition: Wakeup threshold 94 mg @4g range
setRawRegisterValue(AUTOLOWPOW_1_REG_ADDR, 0b00000010); //Configure Auto wakeup to switch from lowpower to normal mode
//HW Interrupt
setRawRegisterValue(INT_CONFIG0_REG_ADDR, 0b00000100); //Enable Gen1 Interrupt
setRawRegisterValue(INT1_MAP_REG_ADDR, 0b00000100); //Map Interrupts to Pin1 (Gen1 Interrupt)
//setRawRegisterValue(INT1_MAP_REG_ADDR, 0b00000101); //Map Interrupts to Pin (Gen1 + Wake Up Interrupt)
setRawRegisterValue(INT2_MAP_REG_ADDR, 0b00000001); //Map Interrupts to Pin2 (Wake Up Interrupt)
setRawRegisterValue(INT12_IO_CTRL_REG_ADDR, 0b00100010); //Configure Interrupt Behavior Here the function that checks the status register for bit 3 set: bool BMA400_Gen1_Intr_status(){
int value =getRawRegisterValue(INT_STAT0_REG_ADDR, 1);
if(value&0x04){
return true;
}else{
return false;
}
}
... View more