Good morning, i start working with BMA400 accelerometer and i would like to detect activity mode. I want to blink a led each time a receive an interrupt. Setup procedure: BMA_WriteRegister(0x7E, 0xB6); --> software reset (maybe optional) BMA_WriteRegister(0x19, 0x02); --> normal mode BMA_WriteRegister(0x1A, 0x38); --> range 2G, ODR 100 HZ, osr highest accuracy BMA_WriteRegister(0x21, 0x04); --> enable generic interrupt 1 to int1 pin BMA_WriteRegister(0x20, 0x00); --> non latched mode BMA_WriteRegister(0x24, 0x02); --> int1 pin interrupt High active BMA_WriteRegister(0x3F, 0xFB); --> enable X,Y,Z axis, data source = acc_filt2, update every time, hysteresis = 96 mg BMA_WriteRegister(0x40, 0x02); --> enable activiy detection with OR logic BMA_WriteRegister(0x41, 0x01); --> set threshold BMA_WriteRegister(0x42, 0x00); --> set duration time BMA_WriteRegister(0x43, 0x01); --> set duration time BMA_WriteRegister(0x1F, 0x04); --> gen1 interrupt in normal mode The code works: if i move my accelerometer, i can blink a led but i have some questions about my configuration: 1) is it right that OR logic generates an interrupt if the acceleration detected by the sensor from at least one of its axis is over a threshold and for AND logic detects an interrupt if the acceleration is detected from all the axis at the same time? 2) if i want to reduce the number of interrupt (now i receive a lot of interrupts) i have to modify threshold and duration register? best regards, Alessandro
... View more