Datasheet

BMA250E
Data sheet
Page 39
BST-BMA250E-DS004-06 | Revision 1.3 | April 2015 Bosch Sensortec
© Bosch Sensortec GmbH reserves all rights even in the event of industrial property rights. We reserve all rights of disposal such as copying and passing on to
third parties. BOSCH and the symbol are registered trademarks of Robert Bosch GmbH, Germany.
Note: Specifications within this document are subject to change without notice.
4.7.8 Flat detection
The flat detection feature gives information about the orientation of the devices´ z-axis relative
to the g-vector, i. e. it recognizes whether the device is in a flat position or not.
The flat angle is adjustable by (0x2E) flat_theta from 0° to 44.8°. The flat angle can be set
according to following formula:
flat_theta
8
1
atan
A hysteresis of the flat detection can be enabled by (0x2F) flat_hy bits. In this case the flat
position is set if the angle drops below following threshold:
16
_
1024
_
1flat_theta
8
1
atan
,
hyflathyflat
llhyst
The flat position is reset if the angle exceeds the following threshold:
16
_
1024
_
1flat_theta
8
1
atan
,
hyflathyflat
ulhyst
The flat interrupt is enabled (disabled) by writing ´1´ (´0´) to bit (0x16) flat_en. The flat value is
stored in the (0x0C) flat bit if the interrupt is enabled. This value is ´1´ if the device is in the flat
position, it is ´0´ otherwise. The flat interrupt is generated if the flat value has changed and the
new value is stable for at least the time given by the (0x2F) flat_hold_time bits. A flat interrupt
may be also generated if the flat interrupt is enabled. The actual status of the interrupt is stored
in the (0x09) flat_int bit. The flat orientation of the sensor can always be determined from
reading the (0x0C) flat bit after interrupt generation. If unlatched interrupt mode is used, the
(0x09) flat_int value and hence the interrupt is automatically cleared after one sample period. If
temporary or latched interrupt mode is used, the (0x09) flat_int value is kept fixed until the latch
time expires or the interrupt is reset.
The meaning of the (0x2F) flat_hold_time bits can be seen from Table 18.
Table 18: Meaning of flat_hold_time
(0x2F)
flat_hold_time
Time
00b
0
01b
512 ms
10b
1024 ms
11b
2048 ms