Data Sheet
BHA250 / BHA250B
Ultra low-power sensor hub incl. integrated Accel
Bosch Sensortec
Data Sheet
Document revision
1.2
Document release date
Mar 2017
Document number
BST-BHA250(B)-DS000-01
Technical reference code(s)
BHA250: 0 273 141 231
Notes
Data in this document are subject to change without notice. Product photos
and pictures are for illustration purposes only and may differ from the real
product’s appearance.
BHA250B: 0 273 141 310
BHA250(B)
Data sheet
Features
- All-in-one smart-hub solution for always-on motion
sensing at a fraction of current consumption which is
commonly required using discrete components.
- 32-bit floating-point microcontroller (Fuser Core).
Optimized for data fusion, motion sensing and activity
recognition at ultra low power consumption. All in order
to offload the power hungry data processing from the
main application processor to the smart-hub.
- Powerful BSX sensor fusion library integrated in ROM
for lowest design-in effort and fastest time-to-market.
- Additional software and algorithms for RAM processing,
provided as ready to use FW patch files. Visit our web
site to check available downloads.
- Onboard calculation power for data fusion, 3D- and
absolute orientation, rotation vector, quaternions and
Euler angles.
- Gesture recognition of significant motion, tilt, pickup,
wake up and glance. Enabling customer specific
gesture based HMI interfaces for smartphones and
wearables.
- Activity recognition of standing, walking, running, biking
and in vehicle. Enabling health & fitness applications or
any other use case where highly accurate and reliable
detection and/or monitoring of user activities is required.
- Step detection and step counting.
- Android 5 / L / Lollipop & Android 6 / M / Marshmallow
(non-HiFi) support, incl. batching with dual FIFO buffer
for wakeup and non-wakeup events. Implements the full
Android sensor stack although an Android OS or any
other Android environment is not required.
- High speed I2C interface, with data rates up to 3.4
MBit/s for power-efficient data transfer.
- Highly configurable internal RAM for either feature
extension and/or FIFO data buffering.
- SW / FW based functionality. Can be updated,
optimized, customized or upgraded with totally new
features to support future requirements.
- Smart-hub plus microcontroller, MEMS sensors and
software all highly integrated in one 2.2x2.2x0.95 mm3
LGA package with extension interface for additional
sensors.
Page 2
General Description
The BHA250(B) is a small, low-power smart-hub
with an integrated three axis accelerometer plus a
programmable microcontroller, all specifically
designed to enable always-on motion sensing. On
top it contains software and algorithms for motionstep-, gesture- and activity recognition. The overall
concept perfectly matches the requirements of
smartphones, wearables or any other application
which demands highly accurate, real-time motion
data at very low power consumption.
The device integrates our millionfold proven 14bit
acceleration sensor with a microcontroller – the new
Bosch Sensortec Fuser core. It is bringing you the
full Android sensor stack inside your devices – even
without having an Android OS or an Android
environment. Combining this with the built in
computing power and the highly configurable onboard memory the BHA smart-hub offers you a low
power solution for motion sensing and data
processing.
Target applications
•
Activity recognition of standing, walking,
running, biking or in vehicle
•
HMI interfaces incl. gesture detection of
motion, tilt, pickup, wake up and glance
•
Step detection and step counting
•
Indoor navigation, PDR
•
Augmented reality, immersive gaming
•
Tilt compensated eCompass and
orientation
Target devices
•
Mobile phones and tablets
•
Wearables such as smart watches, wristor neck-bands
•
Smart-sports and smart-fitness devices
•
Hearables, smart earphones and other
head worn devices
•
Smart-TV- or AR/VR controllers
•
Smart-pens
Implemented Sensor Types
With integrated acceleration sensor only:
Accelerometer, Step counter, Step detector, Significant
motion, Tilt gesture, Pickup gesture, Wake up gesture,
Glance gesture, Activity recognition
With attached gyroscope:
Gravity, Linear acceleration, Gyroscope, Gyroscope
uncalibrated, Game rotation vector
With attached magnetometer:
Geomagnetic field, Magnetic field uncalibrated,
Orientation, Rotation vector, Geomagnetic rotation vector
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 3
Table of Contents
1. SPECIFICATION.................................................................................................................... 7
1.1 ELECTRICAL SPECIFICATION ................................................................................................ 7
1.2 ELECTRICAL AND PHYSICAL CHARACTERISTICS, MEASUREMENT PERFORMANCE .................. 7
1.3 ABSOLUTE MAXIMUM RATINGS ............................................................................................ 9
2. PIN CONNECTIONS AND DESCRIPTION......................................................................... 10
2.1 CONNECTION DIAGRAM .................................................................................................... 11
3. OVERVIEW .......................................................................................................................... 12
4. PHYSICAL INTERFACES ................................................................................................... 14
4.1 HOST INTERFACE .............................................................................................................. 14
4.2 SENSOR INTERFACE ......................................................................................................... 15
5. DATA INTERFACE.............................................................................................................. 16
5.1 GENERAL OVERVIEW......................................................................................................... 16
5.2 REGISTER MAP ................................................................................................................. 17
6. DEVICE INITIALIZATION AND STARTUP......................................................................... 19
6.1 RESET .............................................................................................................................. 19
6.2 BOOT MODE ..................................................................................................................... 19
6.3 MAIN EXECUTION MODE ................................................................................................... 19
7. DEVICE CONFIGURATION ................................................................................................ 21
8. FIFOS AND EVENTS........................................................................................................... 22
9. FUNCTIONAL DESCRIPTION ............................................................................................ 23
9.1 DATAFLOW OF SENSOR FUSION ........................................................................................ 23
9.2 SUPPORTED DATA RATES OF BSX SENSOR FUSION ENGINE ............................................. 23
9.3 GESTURE RECOGNITION ................................................................................................... 24
9.4 POWER M ODES AND CURRENT CONSUMPTION ................................................................. 24
9.5 VIRTUAL SENSORS ........................................................................................................... 25
9.6 VIRTUAL SENSOR DATA TYPES ......................................................................................... 27
9.7 SENSOR CONFIGURATION ................................................................................................. 28
9.8 SENSOR STATUS INFORMATION ........................................................................................ 29
9.9 FIFOS .............................................................................................................................. 30
9.10 NON-BATCH MODE ......................................................................................................... 31
9.11 BATCH MODE ................................................................................................................. 31
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 4
10. REGISTER MAP DESCRIPTION...................................................................................... 32
10.1 BUFFER_OUT[0:49] ........................................................................................................ 32
10.2 FIFO_FLUSH.................................................................................................................. 32
10.3 CHIP_CONTROL.............................................................................................................. 33
10.4 HOST_STATUS ............................................................................................................... 33
10.5 INT_STATUS ................................................................................................................... 34
10.6 CHIP_STATUS ................................................................................................................ 34
10.7 BYTES_REMAINING[0:1] ................................................................................................. 35
10.8 PARAMETER_ACKNOWLEDGE ......................................................................................... 35
10.9 PARAMETER_READ_BUFFER[0:15]................................................................................. 36
10.10 GP[20:24] .................................................................................................................... 36
10.11 PARAMETER_PAGE_SELECT ........................................................................................ 36
10.12 HOST_INTERFACE_CONTROL ....................................................................................... 38
10.13 GP[31:36] .................................................................................................................... 40
10.14 PARAMETER_WRITE_BUFFER[0:7] ............................................................................... 40
10.15 PARAMETER_REQUEST ................................................................................................ 40
10.16 GP[46:52] .................................................................................................................... 41
10.17 ROM_VERSION[0:1]..................................................................................................... 41
10.18 RAM_VERSION[0:1] ..................................................................................................... 41
10.19 PRODUCT_ID ............................................................................................................... 42
10.20 REVISION_ID ................................................................................................................ 42
10.21 UPLOAD_ADDRESS[0:1] ............................................................................................... 43
10.22 UPLOAD_DATA ............................................................................................................. 43
10.23 UPLOAD_CRC[0:3] ...................................................................................................... 43
10.24 RESET_REQUEST ......................................................................................................... 44
11. PARAMETER I/O DESCRIPTION..................................................................................... 45
11.1 PARAMETER PAGE 1: SYSTEM ........................................................................................ 45
11.2 PARAMETER PAGE 3: SENSORS ...................................................................................... 50
11.3 SENSOR INFORMATION STRUCTURE ............................................................................... 53
11.4 SENSOR CONFIGURATION STRUCTURE ........................................................................... 54
11.5 PARAMETER PAGE 15: SOFT PASS-THROUGH ................................................................ 55
12. SENSOR DATA TYPES AND OUTPUT FORMAT .......................................................... 57
12.1 QUATERNION+................................................................................................................ 58
12.2 VECTOR+ ....................................................................................................................... 59
12.3 VECTOR_UNCALIBRATED................................................................................................ 60
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 5
12.4 SCALAR DATA................................................................................................................. 60
12.5 SENSOR EVENT DATA (PARAMETERLESS SENSORS)....................................................... 61
12.6 ACTIVITY RECOGNITION DATA (SENSOR_ACTIVITY_REC_DATA) ..................................... 61
12.7 DEBUG ........................................................................................................................... 61
12.8 SENSOR DATA SCALING .................................................................................................. 62
12.9 META EVENTS ................................................................................................................ 63
12.9.1 SELF-TEST R ESULTS .....................................................................................................64
12.9.2 INITIALIZED...................................................................................................................65
13. READING FIFO DATA....................................................................................................... 66
13.1 HOST INTERRUPT BEHAVIOR........................................................................................... 66
13.2 PAUSE AND RESUME MECHANISM................................................................................... 67
13.3 FIFO OVERFLOW HANDLING........................................................................................... 68
13.4 HOST SUSPEND PROCEDURE ......................................................................................... 68
13.5 HOST WAKEUP PROCEDURE........................................................................................... 68
13.6 NON-COMPLIANT HOSTS ................................................................................................ 68
13.7 RECOVERY FROM L OSS OF SYNC.................................................................................... 69
13.8 PADDING DATA ............................................................................................................... 69
13.9 ABORTING A TRANSFER .................................................................................................. 69
13.10 FIFO PARSING EXAMPLES ............................................................................................ 69
13.10. 1 ACCELEROMETER & STEP COUNTER ..............................................................................69
14. PACKAGE.......................................................................................................................... 72
14.1 OUTLINE DIMENSIONS..................................................................................................... 72
14.2 SENSING AXES ORIENTATION AND AXIS REMAPPING ....................................................... 72
14.3 LANDING PATTERN RECOMMENDATION ............................................................................ 74
14.4 MARKING ........................................................................................................................ 75
14.4.1 MASS PRODUCTION .......................................................................................................75
14.4.2 ENGINEERING SAMPLES .................................................................................................75
14.5 SOLDERING GUIDELINES ................................................................................................. 76
14.6 HANDLING INSTRUCTIONS ............................................................................................... 77
14.7 TAPE AND REEL SPECIFICATION ...................................................................................... 77
14.7.1 ORIENTATION WITHIN THE REEL .......................................................................................78
14.8 ENVIRONMENTAL SAFETY ................................................................................................ 78
14.9 HALOGEN CONTENT ........................................................................................................ 78
14.10 MULTIPLE SOURCING .................................................................................................... 78
15. LEGAL DISCLAIMER........................................................................................................ 79
15.1 ENGINEERING SAMPLES .................................................................................................. 79
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 6
15.2 PRODUCT USE ................................................................................................................ 79
15.3 APPLICATION EXAMPLES AND HINTS ................................................................................ 79
16. DOCUMENT HISTORY AND MODIFICATIONS .............................................................. 80
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 7
1. Specification
1.1 Electrical specification
Table 1: Operating Conditions
Parameter
Supply Voltage
Internal Domains
Supply Voltage
I/O Domain
Voltage Input
Low Level
Voltage Input
High Level
Voltage Output
Low Level
Voltage Output
High Level
Operating
Temperature
1.2 Electrical
OPERATING CONDITIONS BHA
Condition
Min
1.62
Typ
2.4
Max
3.6
Unit
V
VDDIO
1.6
2.4
3.3
V
VIL,a
0
0.3VDDIO
V
VIH,a
0.7VDDIO
VDDIO
V
0.3V
V
Symbol
VDD
VOL,a
IOL=1mA
VOH,a
IOH=-1mA,
TA
VDDIO-0.3V
V
-40
+85
°C
and physical characteristics, measurement performance
All parameters defined for operating conditions (unless otherwise specified)
Table 2: Electrical characteristics Fuser Core
OPERATING CONDITIONS FUSER CORE
Parameter
Symbol
REGULATOR OUTPUT
VOLTAGE
POWER ON RESET
THRESHOLD
CURRENT
CONSUMPTION,
RUN1
CURRENT
CONSUMPTION,
NORMAL
OPERATION2
CURRENT
CONSUMPTION,
SLEEP3
CURRENT
CONSUMPTION,
DEEP SLEEP4
CURRENT
CONSUMPTION,
IDLE5
VREG
Condition
VPOR
VREG>VPOR
IRUN
Min
Typ
Max
Units
1.0
1.1
1.2
V
0°C TO +40°C, (1)
VREG125MV
800
V
UA
IOPER
0°C TO +40°C, (2)
350
UA
ISLEEP
0°C TO +40°C, (3)
40
UA
IDSLEEP
0°C TO +40°C, (4)
7
UA
IIDLE
0°C TO +40°C, (5)
6
UA
Notes:
(1) Current consumption when CPU is running and executing from ROM.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 8
(2) Current consumption in normal operation is average consumption for 9DoF Sensor
Fusion with ODR of 100 Hz
(3) Sleep mode is entered when CPU and I2C are idle and timer and system clock are
enabled
(4) In Deep Sleep mode, only timer is enabled while system clock is disabled
(5) In Idle mode, no operations are performed, all oscillators are disabled
Table 3: Electrical characteristics accelerometer
OPERATING CONDITIONS ACCELEROMETER
Parameter
Symbol
Condition
Min
gFS2g
Acceleration Range
gFS4g
gFS8g
Selectable
via serial digital
interface
gFS16g
Typ
Max
Units
±2
g
±4
g
±8
g
±16
g
OUTPUT SIGNAL ACCELEROMETER
Parameter
Symbol
Condition
Resolution
Sensitivity
Typ
Max
Units
14
bit
S2g
gFS2g, TA=25°C
4096
LSB/g
S4g
gFS4g, TA=25°C
2048
LSB/g
S8g
gFS8g, TA=25°C
1024
LSB/g
S16g
gFS16g, TA=25°C
512
LSB/g
±0.02
%/K
0.05
%/V
±80
mg
±1
mg/K
0.5
mg/V
Sensitivity
Temperature Drift
TCSa
Sensitivity
Supply Volt. Drift
SVDD,a
Zero-g Offset
Off
Zero-g Offset
Temperature Drift
Zero-g Offset
Supply Volt. Drift
Min
TCOa
OffVDD,a
gFS2g,
Nominal VDD supplies
gFS2g, TA=25°C,
VDD_min ≤ VDD ≤ VDD_max
gFS2g, TA=25°C, nominal
VDD supplies, over lifetime
gFS2g,
Nominal VDD supplies
gFS2g, TA=25°C,
VDD_min ≤ VDD ≤ VDD_max
Nonlinearity
NLA
Best fit straight line,
gFS2g
±0.5
%FS
Output Noise
Density
nrms,a
gFS2g, TA=25°C, nominal
VDD supplies, Normal
mode
150
µg/√Hz
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 9
1.3 Absolute maximum ratings
PARAMETER
Table 4: Absolute maximum ratings
Condition
Min
Voltage at Supply Pin
Max
Units
VDD Pin
-0.3
4.25
V
VDDIO Pin
-0.3
3.6
V
Voltage at any Logic Pin
Non-Supply Pin
-0.3
VDDIO+0.3
V
Passive Storage Temp. Range
≤65% rel. H.
T = 85°C,
after 15 cycles
-50
10
+150
°C
y
Duration 200 µs, half
sine
10,000
g
Duration 1.0 ms, half
sine
2,000
g
Free fall
onto hard surfaces
1.8
m
HBM, at any Pin
2
kV
CDM
500
V
MM
100
V
None-volatile memory (NVM)
Data Retention
Mechanical Shock
ESD
NOTE: Stress above these limits may cause damage to the device. Exceeding the specified electrical
limits may affect the device reliability or cause malfunction.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 10
2. Pin Connections and description
Figure 1: Pin Connections
Bottom view
(Pads visible)
Table 5: Pin description
Pin
Name
Description
1
INT
Host interrupt
2
SCK
I2C serial clock (Host interface)
3
ASCK
4
ASDA
5
6
VREG
GPIO1
I2C Master serial clock, for
connecting to external sensors
I2C master serial data, for
connecting to external sensors
Regulator filter capacitor connection
Application specific I/O pin1)
7
RESV1
Do not connect pin (reserved)
8
GPIO2
Application specific I/O pin
9
GND
Analog power supply ground
10
SA_GPIO7
Select I2C address & Application specific I/O pin
refer to section 4.1 page 14
11
GNDIO
Digital I/O power supply ground
12
VDD
13
VDDIO
14
SDA
1)
Analog power supply voltage
(1.71V ... 3.6V)
Digital I/O power supply voltage
(1.6 … 3.3 V)
I2C serial data (Host interface)
GPIO1 is driven low at power up until firmware download is completed
and BHA is initialized.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 11
2.1 Connection Diagram
Figure 2: Reference Diagram
VDDIO
R1
R2
R4
R3
AVDD
For R3, R4 refer to below given note!
C2
C3
C4
GPIO1
GPIO2
SA_GPIO7
AVDD
External Sensor 1
(e.g. Magnetometer)
GND
Component
VDDIO
GNDIO
SCK
SCK
VDDIO
SDA
INT
AVDD
INT
INT
ASCK
ASDA
SDA
INT
BHA
BHA250
GNDIO
SCK
SDA
GND
SCK
SDA
GNDIO
Host
System
VREG
VDD
VDDIO
VDDIO
C1
External Sensor 2
(e.g. Pressure)
GND
…
GNDIO
Table 6: Typical values for external circuit components
Value
Remarks
R1
4.7 kΩ
Pull-up resistor for SDA, Host Interface
R2
4.7 k Ω
Pull-up resistor for SCK, Host Interface
R3
4.7 k Ω
Pull-up resistor for ASDA, Aux Interface
R4
4.7 k Ω
Pull-up resistor for ASCK, Aux Interface
C1
100nF
Filter capacitor AVDD
C2
1 µF
Filter capacitor VDDIO
C3
100 nF
Filter capacitor VDDIO
C4
470 nF
Filter capacitor VREG
NOTE: R3 and R4 are mandatory, even if no external sensor is attached.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 12
3. Overview
The BHA Sensor hub is a small multichip system in a LGA package consisting of
•
•
•
•
•
•
a 32-bit floating-point microcontroller (Fuser Core)
optimized for sensor fusion and activity recognition
96 KByte of ROM including the BSX sensor fusion library
48 KByte of RAM for
• feature extension
(e.g. for additional drivers of externally attached sensors)
• local data buffering
(implementing a wake-up and a non-wake-up FIFO as defined in Android
• feature updates
(allowing the updates of features implemented in RAM or ROM to meet
future requirement)
a high speed I2C host interface, with data rates up to 3.4 MBit/s and a host interrupt line
a fast I2C sensor interface, with data rates up to 1 MBit/s for connection
of external sensors
up to 3 additional GPIO pins
Figure 3: Block Diagram
With these integrated hardware and software features, the low power consumption and the sensor
extension interface, the BHA provides an ideal all-in-one solution for always-on sensor applications.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 13
Without any additionally attached sensors the BHA provides a three degrees of freedom (3-DoF)
acceleration sensor out of the box, implementing the following Android 1 sensor types:
•
•
•
•
•
•
•
•
•
Accelerometer
Step counter
Step detector
Significant motion
Tilt detector
Pickup gesture
Wake up gesture
Glance gesture
Activity recognition 2 of standing, walking, running, biking, in vehicle
By attaching an external magnetometer to the sensor interface (and configuring the RAM firmware patch
to include the sensor driver for the magnetometer) the BHA provides additionally the following sensor
types:
•
•
•
•
•
•
•
Gravity
Linear acceleration
Geomagnetic field
Magnetic field uncalibrated
Orientation
Rotation vector
Geomagnetic rotation vector
offering a robust eCompass solution to the user.
With further attachment of additional sensors to the sensor interface, as e.g.
•
•
•
•
•
•
Gyroscope
Barometic pressure
Humidity
Ambient temperature
Proximity
Ambient Light
the BHA can provide the full Android sensor stack to the application.
1
See http://source.android.com/devices/sensors/sensor-types.html for details on defined Android
Sensor Types.
2
Activity recognition is also implemented as a Sensor Type in BHA250, despite not being defined in
Android’s “sensors.h”, but in “activity_recognition.h”.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 14
4. Physical Interfaces
4.1 Host interface
According to the interface concept introduced from Android 5 onwards, the BHA provides a high speed
I2C interface and a single interrupt line as main interface to the application processor.
The available GPIO pins can be used to implement additional interrupt lines, in case this is necessary
for specific applications.
The host interface is implemented as an I2C slave interface, as described in the I 2C bus specification
created from NXP 3 and implements data transfer rates up to 3.4 Mbit/s in the high-speed mode.
The I2C bus consists of 2 wires, SCK (Serial Clock) and SDA (Serial Data). Both bus lines are bidirectional. The BHA250 can be connected to this bus via SDA and SCL pads with open drain drivers
within the device. The bus lines must be externally connected to a positive supply voltage (VDDIO) via
a pull-up resistor or current-source.
A data transfer via the I 2C slave interface is always initiated by the host. The I 2C slave interface can
operate as either a transmitter or receiver only, if a valid device address has been received from the
host.
The BHA250 responds to device addresses, depending on the logic level applied on the SA_GPIO7. To
select the corresponding I2C address keep the desired level for min 10 ns after reset release as
described in Table 7. By default there are 2 application specific I/O pins GPIO1 and GPIO2 available
and recommended. Special cases might require additional I/O pins. Therefore SA_GPIO was designed
to be operated as a third application specific I/O pin, once the I2C address was successfully selected.
For details and technical support please refer to corresponding application notes or contact our regional
offices, distributors and sales representatives.
Table 7: I2C address selection
SA_GPIO7
I2C address
HIGH
0x29
LOW
0x28
The address and data are transferred between master and slave serially through the data line (SDA) in
an 8-bit oriented transfer format. The transfer is synchronized by the serial clock line (SCK). The
supported transfer formats are single byte read, multiple byte read, single byte write, multiple byte write.
The data line (SDA) can be driven either by the host or the BHA. The serial clock line (SCK) is driven
by the host only.
Figure 3 illustrates an example of how to write data to registers in single-byte or multiple-byte mode.
Figure 4: I 2C write example
Figure 4 illustrates an example of how to read data to registers in single-byte or multiple-byte mode.
3
See http://www.nxp.com/documents/user_manual/UM10204.pdf for details
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 15
Figure 5: I2C read example
4.2 Sensor interface
The BHA implements a fast-mode plus I2C master interface for connections of external sensors.
This sensor interface is directly connected to the internal acceleration sensor and also available on the
auxiliary serial clock (ASCK) and auxiliary serial data (ASDA) pins of the BHA.
The bus lines must be externally connected to a positive supply voltage (VDDIO) via a pull-up resistor
or current-source, even if no additional external sensor is attached to the device, in order to enable the
proper I2C communication between the Fuser core and the integrated BMA2x2 acceleration sensor.
A common use-case of the sensor interface is the connection of an external magnetometer.
The following external magnetometers are currently supported:
Table 8: Supported Magnetometers
Vendor
Device
Bosch Sensortec
Asahi Kasei
Yamaha
BMM150
AK09911/12
YAS532/537
Alternative magnetometers can be supported on customer request.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 16
5. Data interface
5.1 General overview
Figure 5 provides a general overview of the BHA data interface. The software running on the Fuser core
obtains the raw sensor from the I 2C sensor interface, performs the necessary computations and provides
the results into a register map, which forms the main I/O interface to the host from a programmer’s point
of view.
Figure 6: BHA data interface
The register map consists of 4 main sections:
•
•
•
•
Sensor Data Buffer
Fuser Core Config & Status Buffer
Configuration Parameter I/O
User specific I/O Buffer
The Sensor Data Buffer consists of 50 register (I2C addresses 0x00:0x31) providing an interface to the
Fuser Core’s internal Event FiFOs which contain the sensor event data.
Per default the data of both FIFOs (the wake-up and the non-wake-up FIFO) will be mapped to the
Sensor Data Buffer, so that the host can read all available data in a burst and identify and separate the
data afterwards.
The FIFO_FLUSH register of the Fuser Core Config & Status Buffer can be used to adjust the behavior
of the sensor data buffer in a more specific way.
The Fuser Core & Status Buffer consist of a register set, which allows the host to control the
fundamental behavior of the fuser core as well as getting information on the current status.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 17
The Configuration Parameter I/O interface provides a window in the various configuration options of
the sensor system. In consists of the 16 Byte deep Par_Read_Buffer (I 2C addresses 0x3B:0x4A) and
the 8 Byte deep Par_Write_Buffer (I 2C addresses 0x5C:0x63) and some additional registers for selecting
and mapping the desired parameters into these 2 buffers.
The User Specific I/O Buffer is reserved for application specific purposes and can be used to serve
the needs of individual applications. It consist of 3 different I 2C address areas (0x4B:0x4F, 0x56:0x5B
and 0x65:0x6B) where the first one is read-only, while the others are read-write for the host.
5.2 Register Map
I2C Adress
Table 9: BHA Register Map
Register Name
Access mode
Map section
0x00 – 0x31
Buffer Out[00:49]
Read only
Sensor Data Buffer
0x32
FIFO Flush
Read write
0x33
Reserved
Fuser Core
Config & Status
0x34
0x35
0x36
0x37
Chip Control
Host Status
Int Status
Chip Status
Read
Read
Read
Read
Fuser Core
Config & Status
0x38
0x39
Bytes Remaining LSB
Bytes Remaining MSB
Read only
Read only
Sensor Data Buffer
0x3A
Parameter Acknowledge
Read only
0x3B – 0x4A
Parameter Read Buffer[0:15]
Read only
0x4B – 0x4F
GP20 – GP24
Read only
Config Parameter
I/O Interface
Config Parameter
I/O Interface
User specific I/O
0x50 – 0x53
Reserved
0x54
Parameter Page Select
Read write
0x55
Host Interface Control
Read write
0x56 – 0x5B
GP31 – GP36
Read write
0x5C – 0x63
Parameter Write Buffer[0:7]
Read write
0x64
Parameter Request
Read write
0x65 – 0x6B
GP46 – GP52
Read write
0x6C – 0x6F
Host IRQ Timestamp
Read only
0x70 – 0x71
0x72 – 0x73
ROM Version
RAM Version
Read only
0x74 – 0x8F
Reserved
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
write
only
only
only
Config Parameter
I/O Interface
Fuser Core
Config & Status
User specific I/O
Config Parameter
I/O Interface
Config Parameter
I/O Interface
User specific I/O
Fuser Core
Config & Status
Fuser Core
Config & Status
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
0x90
0x91
Product ID
Revision ID
0x92 – 0x93
Reserved
0x94 – 0x95
0x96
0x97 – 0x9A
0x9B
Page 18
Read only
Read only
Chip specific IDs
Upload Address
Upload Data
Upload CRC
Read write
Read write
Read only
Reset Request
Read write
Fuser Core
Config & Status
(Firmware upload
interface)
Fuser Core
Config & Status
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 19
6. Device Initialization and Startup
The procedure in order to initialization and startup the BHA until it reaches its normal operation mode
consist mainly of the following steps:
1.
2.
3.
4.
5.
6.
7.
8.
Power on or reset the device
Wait for Interrupt
Upload the Firmware (RAM patch)
Switch into main execution mode
Wait for Interrupt
Configure the sensors and meta events
Configure the FIFO buffers
Configure the host interrupt setting
Once this procedure is successfully finished, the host can go into sleep mode and wait for the BHA’s
interrupt, according to the defined conditions (see step 6).
If the host receives an interrupt request from the BHA250, it can simply read out the FIFO buffer and
parse the obtained data. (See section 13 for details on how to read the FIFO buffer)
6.1 Reset
The BHA does not provide a specific hardware pin for a reset. A reset can be triggered due to
• Power On Reset
• Watchdog Reset
• Host initiated Reset Request
In order to trigger a reset request, the host has to write a 1 into the Reset_Request register (Address
0x9B in the register map). This bit automatically clears to 0 after reset.
6.2 Boot Mode
The ROM is split into two parts, a small boot loader and the larger set of libraries and drivers which can
be used by a RAM-based firmware or “patch.”
It is this latter part of the ROM which provides most of the functionality required for sensor fusion, host
interface interactions, data batching, and so on. However, without a RAM patch, none of these more
advanced behaviors can occur. This is where boot loading comes in.
When the BHA first comes out of reset it executes the ROM boot loader. The boot loader performs the
default initialization of the BHA, apply factory trim values, initialization of the host interrupt line, etc,
generates an interrupt request to the host and goes into halt mode.
In halt mode, the host may directly load a RAM patch using the firmware update interface registers
(Address 0x94-0x9A in the register map) in the Fuser Core Config & Status block.
After the firmware upload procedure is finished successfully, the host can switch the BHA250 into the
main execution mode by writing a 1 to bit 0 (CPU_Run_Request) of the Chip Control register (Address
0x34). A successful execution of the CPU_Run_Request can be detected by checking the RAM Version
registers (Address 0x72-0x73). Before execution of the RAM patch, the RAM Version registers will
contain 0.
6.3 Main Execution Mode
Once in this mode, the full Android host interface and sensor suite is available. The BHA indicates its
readiness by inserting an initialized meta event in the FIFO. The host should wait for this before
attempting to query or configure sensors or other features.
If an incorrect RAM patch has been loaded (for example, is built for a different sensor suite), the FIFO
will instead contain one or more Sensor Error or Error meta events.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 20
In the nominal case, however, the host is now free to query which sensors are present by reading the
Sensor Status bits, learn the details of each sensor by querying the Sensor Information parameters ,
load any Warm Start values using the Algorithm Warm Start parameters, and/or configure sensors to
start generating output using the Sensor Configuration parameters.
The host may also wish to configure which meta events will appear in the FIFOs, such as FIFO Overflow,
Watermark, or many others. It can specify whether certain meta events can cause an immediate host
interrupt, or are batched until later.
Finally, the host may wish to configure the optional Watermark values using the FIFO Control parameter.
This allows the host to be informed that either one or both of the FIFOs have reached a level at which
the host shall read its contents to avoid data is loss. This is especially useful when the Application
Processor is asleep.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 21
7. Device Configuration
A set of registers (the Fuser Core Config & Status block) can be used to configure the fundamental
behavior of the CPU core and the host interface (see section 10 for a detailed description of the specific
registers). Besides this basic configuration, the full flexibility of the BHA is offered through the
Configuration Parameter I/O interface.
The Configuration Parameter I/O interface, is provided through registers of the BHA and consists of
•
Parameter_Read_Buffer[0:15] (0x3B – 0x4A)
in order to read a specific parameter set out the BHA’s config parameter area
•
Parameter_Write_Buffer[0:7] (0x5C – 0x63)
in order to write a specific parameter set into the BHA’s config parameter area
•
Parameter_Page_Select (0x54), Parameter_Request (0x64), Parameter_Acknowledge (0x3A)
for the required handshaking.
In general, the Configuration Parameter I/O interface basically copies a specific parameter set either
from the parameter area into the read buffer (read access) or from the write buffer into the specified
parameter area (write access).
The procedure for a read access works a follow:
In order to get the a copy of the desired parameter inside the read buffer, the host requests a
parameter set by writing the requested page into the Parameter_Page_Select register and the desired
parameter set into the Parameter_Request register.
Afterwards the host waits for an acknowledgement, by polling the Parameter_Acknowledge register
until it matches the desired parameter number (or indicates an error). The acknowledgment indicates
that the Parameter_Read_B uffer has been updated with the values of the requested parameter.
The host can read more parameters within the same page by writing a new Parameter Request
register value, polling for a match in the Parameter Acknowledge register, then reading the new
parameter’s value from the Parameter Read Buffer area.
The host ends the parameter transfer procedure by writing the Parameter Page Select register with 0.
The procedure for a write access works a follow:
The host writes the new data for a specific parameter set into the Parameter_Write_Buffer. In order to
address the specific dataset it writes the desired parameter page into the Parameter_Page_Selec t
register and the specific parameter set into the Parameter_Request register.
Afterwards the host waits for an acknowledgement, by polling the Parameter_Acknowledge register
until it matches the desired parameter number (or indicates an error). The acknowledgment indicates
that the Parameter_Write_Buffer has been copied inside the addressed parameter set.
The host may write another parameter in the same page by repeating the procedure.
The host ends the parameter transfer by writing a 0 into the Parameter_Request register.
A detailed description of the various parameters and their organization into several parameter pages is
given in section 11 Parameter I/O Description.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 22
8. FIFOs and Events
Understanding the concept of FIFOs and Events is fundamental for proper operation of the BHA. Both
elements are implemented into the device in order to meet the requirements of Android.
Every piece of information the BHA delivers to the host is treated as an Event and placed into a FIFO.
FIFOs
BHA provides two FIFOs: a wakeup and a non-wakeup FIFO.
The non-wakeup FIFO will never trigger an interrupt request to the host when the host is in sleep mode
(in default configuration).
(The host should inform the BHA about using the AP_SUSPENDED bit (bit 5) in the
Host_Interface_Control register (0x55))
If the non-wakeup FIFO is full, while the host is in sleep mode, the non-wakeup FIFO is allowed to
overflow, discarding the oldest data to make room for new data as they arrive.
The wakeup FIFO may trigger an interrupt request, depending on the current configuration, for different
reasons, even if the host is in sleep mode. One obvious reason is to avoid, that the wakeup FIFO
overflows (configured by the wakeup FIFO watermark level setting) or the events in the FIFO become
too old (configured by the max report latency setting).
There are more reasons, see section 11 and 13 for further details.
Events
In order to implement a generalized and efficient handling mechanism for sensor data the concept of
sensor events is used within the BHA.
A sensor event consists of the sensor ID of the virtual sensor generating the event and, the data
according to the data type of the specific sensor. It is placed into a FIFO, when it occurs.
Events can be generated continuously, e.g. if a virtual sensor is setup to produce data samples on a
configured data rate, or as single events, e.g. when a step or significant motion is detected.
To make use of the event concept in a generalized way, the virtual sensor IDs – which are originating
from (and thus are identical to) the virtual sensor definitions in the Android CDD – are extended by
additional IDs not necessary related to virtual sensors.
In a first step, each virtual sensor gets a second sensor ID in order to distinguish wakeup from nonwakeup events.
In a second step, additional event IDs are introduced in order to handle non sensor related information,
like timestamps and meta events.
A detailed description of all available event IDs is provided in the following sections.
Using this event concept, the BHA’s output data will be sent in a continuous stream, with each event
(e.g. a sensor sample) uniquely identified. Because many sensors produce output at the same time,
the timestamp event is only introduced once into the FIFOs at the start of a series of sensor samples
that occurred at the same time. This saves space in the buffer.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 23
9. Functional description
9.1 Dataflow of Sensor Fusion
The integrated Fuser Core receives raw sensor data from the connected sensors and provides
calibrated (virtual) sensor data to the application processor. The raw sensor data flows from the sensor
with a maximum ODR 200 Hz to the fuser core. The BSX library runs sensor fusion (when required)
using this high speed data, to avoid loss in signal quality. The results are subsampled to the ODR
required by the host processor.
Figure 7: Dataflow
9.2 Supported data rates of BSX Sensor Fusion Engine
The following output data rates configuration can be selected by the host processor, these are support
in both sensor only and data fusion operating modes:
Table 10: Supported BSX output data rates
BSX output data rate
200Hz
100Hz
50Hz
25Hz
12.5Hz
The actual output data rate requested by Android will be provided according to the Android requirement s
and derived from the above mentioned internal data rates. I.e., the actual output data rate will be in the
range of 90%...210% of the requested data rate. Output samples are generated by subsampling from a
suitable data rate from Table 10.
If multiple virtual sensors with different output data rates are requested by Android, the internal data rate
will be selected such that all output data rates can be generated according to the Android requirements .
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 24
9.3 Gesture recognition
Android defines 3 gestures have to be implemented in the system, but leaves the functional
implementation open to the device provider. The BHA allows individual gestures to be implemented and
mapped on the above mentioned system gestures. By default the firmware of the BHA performs the
following mapping of gestures to the virtual gesture sensors:
•
Wakeup Gesture
Double Tap on the device
•
Pickup Gesture
Pickup the device from a surface (table) and hold it in a 45° angle in relation to gravity
•
Glance Gesture
Move (Slide) the phone left and right on the surface (table) without lifting it up
9.4 Power Modes and Current Consumption
The power modes of the Fuser Core and the connected sensors are configured automatically,
depending on which virtual sensors are requested by the host, and the resulting fusion mode.
After startup, the list of requested sensors is empty, i.e. the firmware switches the connected sensors
into standby mode and then also sets the processor to sleep. Once a virtual sensor has been requested
by the host, the requested physical sensors is enabled and the BSX library is set into a working mode
that supports the requested sensors.
In general, the uC can be in operation or in sleep. Each interrupt will wake the uC out of sleep, e.g. to
process a new data sample from a sensor. When the processing is complete the uC returns to sleep
again.
The current consumption of the Fuser Core in sleep mode is ~7µA, in full operation it is ~800µA. The
actual average current consumption therefore depends of the amount of time the uC is in full operation
mode, which in turn depends on the selected operation mode.
Current Consumption per operation mode
The following exemplary average current consumptions can be reached in the various operation mode
of the BHA, within an isolated use case consideration. The total value includes both the processing in
the Fuser Core and the MEMS Sensor power consumption (including the intrinsic ASIC and an estimate
for the external magnetometer sensors, where required).
Please note that there is no linear addition of the exemplary values given in the following table if the use
cases are not isolated but combined. In this case the resulting total current consumption is always lower
than its single fractions.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 25
Table 11: Power consumption vs. operating mode
Current
Consumption (µA
Typical)
Use Case
Significant Motion
Step Counting
Activity recognition
Rotation Vector
eCompass
Standby
Device
BHA250
Accelerometer
50
Fuser Core
50
Total
100
Accelerometer
50
Fuser Core
50
Total
100
Accelerometer
50
Fuser Core
150
Total
200
Accelerometer
200
Magnetometer
300
Fuser Core
300
Total
800
Accelerometer
3
Magnetometer
1
Fuser Core
7
Total
11
9.5 Virtual Sensors
Virtual sensors are the interface to the Android application layer and are directly requested from there.
The BHA supports all Virtual Sensors as defined in the Android CDD. Based on the Android specification
virtual sensor are completely independent. So each virtual sensor has its own data rate (delay), type,
and trigger mode.
Virtual sensors are implemented as software modules within the firmware running on the Fuser Core.
Each virtual sensor SW module may access a physical sensor via its sensor driver, or it may use other
SW modules (e.g. the BSX library) in order to derive processed data based on physical sensors.
The virtual sensors generate sensor events, which may be continuously (e.g. samples at a configured
data rate) or single events (on-change, one-shot, or special; e.g. when a step or significant motion has
been detected). These events are represented as data packets of a specific virtual sensor data type and
are put into the output FIFO of the BHA.
Each of the sensors will be supported as wakeup and non-wakeup sensor and has a fixed ID which
allows distinguishing a wakeup from a non-wakeup version. Each version of a sensor has independent
sample rate and report latency values.
The supported virtual sensors are listed the following table:
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Virtual Sensor
Page 26
Table 12: virtual sensor IDs
ID
ID
(Non
(Wakeup)
Wakeup)
VS_TYPE_ACCELEROMETER
VS_TYPE_GEOMAGNETIC_FIELD
VS_TYPE_ORIENTATION
VS_TYPE_GYROSCOPE
VS_TYPE_LIGHT
VS_TYPE_PRESSURE
VS_TYPE_TEMPERATURE
VS_TYPE_PROXIMITY
VS_TYPE_GRAVITY
VS_TYPE_LINEAR_ACCELERATION
VS_TYPE_ROTATION_VECTOR
VS_TYPE_RELATIVE_HUMIDITY
VS_TYPE_AMBIENT_TEMPERATURE
VS_TYPE_MAGNETIC_FIELD_UNCA LIBRATE D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
33
34
35
36
37
38
39
40
41
42
43
44
45
46
VS_TYPE_GAME_ROTATION_VECTOR
VS_TYPE_GYROSCOPE_UNCALIBRATE D
15
16
47
48
VS_TYPE_SIGNIFICANT_MOTION
17
49
VS_TYPE_STEP_DETECTOR
18
50
VS_TYPE_STEP_COUNTER
VS_TYPE_GEOMAGNETIC_ROTATION_VE CTOR
VS_TYPE_HEART_RATE
VS_TYPE_TILT
19
20
21
22
51
52
53
54
VS_TYPE_WAKEUP
23
55
VS_TYPE_GLANCE
24
56
VS_TYPE_PICKUP
25
57
VS_TYPE_ACTIVITY_RECOGNITION
31
63
VS
Data Type
Vector+
Vector+
Vector+
Vector+
Abs_Scalar
Abs_Scalar_long
Abse_Scalar
Abs_Scalar
Vector+
Vector+
Quaternion+
Abs_Scalar
Abs_Scalar
Vector_Uncalibra
ted
Quaternion+
Vector_Uncalibra
ted
Sensor_Event_D
ata
Sensor_Event_D
ata
Abs_Scalar
Quaternion+
Abs_Scalar_short
Sensor_Event_D
ata
Sensor_Event_D
ata
Sensor_Event_D
ata
Sensor_Event_D
ata
Sensor_Activity_
Rec_Data
In
ROM
Librar
y
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Virtual sensors as defined in Table 12 can be customized and optimized by a firmware update even if
they are originated from the write protected ROM library. Furthermore, an extension by additional virtual
sensors which are not already included in the library can be added to the RAM by a firmware upgrade,
if the necessary physical sensors are available on the PCB and connected to external I2C interface. A
complete description of the sensor types, including non-sensor related IDs (meta events, timestamps),
is provided in section 12. For details and technical support please refer to corresponding application
notes or contact our regional offices, distributors and sales representatives.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 27
9.6 Virtual Sensor Data Types
Depending on the nature of the sensor and the Android specification different data types are used to
represent the sensor data efficiently. These sensor data types are:
Virtual Sensor Data Type
Table 13: Virtual sensor data types
Data Values
Quaternion+
Vector+
Vector_Uncalibrated
X
Y
Z
W
Estimated Accuracy
X, scaled
Y, scaled
Z, scaled
Meas Accuracy Status
X Uncalibrated, scaled
Y Uncalibrated, scaled
Z Uncalibrated, scaled
X Bias
Y Bias
Z Bias
Meas Accuracy Status
Format
See 12.1 for detailed
description
See 12.2 for detailed
description
See 12.3 for detailed
description
Scalar
Signed scalar value
(16 bit signed int)
See 12.4 for detailed
description
Scalar
Absolute scalar value, scaled
(16 bit signed int)
See 12.4 for detailed
description
Abs_Scalar
Absolute Scalar value
(16 bit unsigned int)
See 12.4 for detailed
description
Abs_Scalar_short
Absolute scalar value
(8 bit unsigned int)
See 12.4 for detailed
description
Abs_Scalar_long
Absolute long scalar value, scaled
(24 bit unsigned int)
See 12.4 for detailed
description
Sensor_Event
(Parameterless)
See 12.5 for detailed
description
Activity_State
See 12.6 for detailed
description
Sensor_Event_Data
Sensor_Activity_Rec_Data
A detailed description of the available sensor IDs and the data formats is provided section 12. This
includes information on the scale factors of the scaled data.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 28
9.7 Sensor Configuration
Each sensor needs to be configured first, before it can be used in the system. The configuration includes
at least the activation of the sensor, but there are more options available:
•
Activate – enable or disable the sensor: Boolean
•
Batch – enable by setting the maximum report latency or disable by setting to zero: Integer
(nanosecond resolution or larger)
•
Delay (Sample Period) – must be equal or less than the requested value, but no smaller than
the Delay / 2: Integer (nanosecond resolution or larger)
•
Flush – send all batched samples (if any) immediately, then send a special meta data type
indicating the flush is complete
•
Poll – read a specified number of samples: Integer
•
Wakeup – if a sensor is opened as a wakeup sensor (using a flag), then it is allowed to interrupt
the host, either when each sample is available or after the maximum report latency. If opened
as a non-wakeup sensor, then they must not interrupt the host. Data for the wakeup vs. nonwakeup sensors go in separate FIFOs.
These are combined into the following settings in the BHA hardware:
•
Sample rate: set to 0 to disable the sensor: unsigned 16 bit integer, in Hz; this is 1 / sample
period; on-change, one-shot, and special sensors should be set to a non-zero value to enable
them or 0 to disable. The sample rate of the non-wake-up and wake-up sensor of the same type
can be set independently.
•
Max report latency: set to 0 for non-batch mode, nonzero for batch mode; if nonzero, sample
period must also be nonzero: unsigned 16 bit integer, in milliseconds. The max report latencies
of the non-wake-up and wake-up sensor of the same type can be set independently.
•
Wakeup vs. non-wakeup: this is implemented using a special bit in the Sensor ID (IDs > 32 are
wakeup).
•
Flush sensor: flush the samples for a specific sensor’s FIFO or all sensor data. See 10.2 for
more details.
•
Change sensitivity: unsigned 16 bits; same scaling as the sensor’s corresponding data value
(for future Win8/10 compatibility)
•
Dynamic range: unsigned 16 bits; specified in terms of commonly used units such as g-s for
accelerometers and degrees / second for gyroscopes (for custom use)
The configuration of the sensor is performed using the Config Parameter I/O (sensors parameter page)
interface and is described in section 11.2 in detail. Notes:
•
Lollipop does not require the ability to set the dynamic range or resolution of any sensors. The
only configurable items at the HAL to sensor driver interface are below. However, the BHA
does provide a dynamic range setting for custom use.
•
Since the HAL / driver will be given the sample rate (period) and max report latency at the
same time, and since they map to 8 bytes of data, they can be sent to the BHA in a single 8
byte parameter write. Each unique sensor (physical or virtual) would be assigned a unique
Parameter number.
•
Writing this Parameter modifies the values; reading this Parameter returns the actual sample
rate and actual report latency. The actual sample rate will be in the range of 90% ... 210% of
the requested sample rate. While this ability to query the actual sample rate is not required by
Lollipop, it is useful for external testing, debugging, and non-Lollipop applications. If the
requested sensor is not present, the returned sample rate and report latency will be 0.
•
The flush mechanism is done using a single 8 bit GP register. Android OS defines a special
meta data value to be placed in the buffer to indicate the flush of a specific sensor has been
completed. So this meta data information goes into FIFO.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 29
9.8 Sensor Status Information
Android sensor drivers need to make the following information available about each supported sensor.
This information are provided by the BHA via a sensor status information structure, available also
through the Config Parameter I/O (sensors parameter page) interface (see section 11.2 for details).
The available sensor status information parameters are:
•
Name – unique; if there are multiple sensors in the system of the same type, each one must
have a unique name; this can be derived from the BHA sensor’s driver ID and slave I2C address
•
Vendor – vendor of the underlying HW; this can be derived from the BHA sensor’s driver ID
•
Version – version of the HW + driver; must change when the driver’s output changes in some
way. It is derived from driver version reported by BHA plus driver-specific version information
•
Type – sensor type, e.g., SENSOR_TYPE_ROTATION_VECTOR; same as sensor data packet
type
•
maxRange – the maximum possible sensor value in SI units (e.g. an accelerometer set for a 4g
range would report 4g here); derived from sensor dynamic range
•
resolution – smallest difference between two values reported by this sensor derived from sensor
dynamic range and bits of resolution (e.g., an accelerometer at 4g range and 16 bit signed
values could report 4g/32767 = 1.2xe-4 g)
•
power – rough estimate of sensor’s power consumption in 0.1 mA; this appears to be only
queried at reboot by Android, and is defined to be the maximum power consumed when in use
•
minDelay – continuous sensors report minimum period in microseconds; on-change sensors
report 0; one-shot sensors report -1
•
maxDelay – continuous sensors report maximum period in microseconds
•
fifoReservedEventCount – number of events reserved for this sensor in the batch FIFO; since
a single FIFO for all sensors is used in the BHA, this means that no area is reserved specially
for any one sensor, so this returns 0
•
fifoMaxEventCount – maximum number of events that could be batched; since the FIFO is
shared, this is the size of the FIFO in bytes divided by the number of bytes per sample
•
flags - only one is defined -- wakeup
In the BHA, these are combined into the following fields:
•
Sensor Type: unsigned 8 bits
•
Driver ID: unsigned 8 bits
•
Driver Version: unsigned 8 bits
•
Max Range: signed 16 bits; scaled the same as the sensor’s corresponding data value
•
Resolution: signed 16 bits; number of bits per sensor (axis) sample
•
Power: unsigned 8 bits; multiples of 0.1 milliamps
•
Max Rate: unsigned 16 bits; rate in Hz
•
Min Rate: unsigned 8 bits; rate in Hz
•
FIFO Reserved: unsigned 16 bits; 0
•
FIFO Max: unsigned 16 bits; total FIFO size in bytes divided by size of data value
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
•
Page 30
Status Bits: unsigned 8 bits; while not required by Lollipop, for testing and debugging the BHA
provides bit flags indicating:
o data_available
o i2c_nack
o
o
o
device_id_error
transient_error (e.g., magnetic transient)
data_lost (FIFO overflow)
o
sensor_power_mode (shutdown, standby, low power active, high power active)
NOTE: the Status Bits will change dynamically at run time, but the other fields are fixed and only read
by the Android HAL once at boot. Therefore, these per-sensor Status Bits are available through a
separate mechanism than the static information, via the sensor status banks, described in section 11.1.
The remaining fields add up to 15 bytes of information. These values, plus the size of a given sensor’s
sample in the FIFO, can be read by the host by reading the Sensor Information structure for a specific
sensor, as described in section 11.3.
Since not all of the possible sensor types will be present in all builds (e.g., one mobile device might have
a barometer but another may not), the host can query this data for all possible sensors, and based on
the returned data, know which sensors are present. If a sensor is not present, all status fields will be
returned with a value of 0. Alternatively, the host can query the Sensor Status Bits for each sensor;
those sensors that are not available will return 0 for the power mode, indicating sensor not present.
9.9 FIFOs
Since sensors in wakeup and non-wakeup versions are supported from Android Lollipop onwards, the
BHA provides two FIFOs.
Each FIFO has independent watermarks, interrupt control, and flush requests.
Under certain conditions, i.e. based on the host interrupt configuration settings (e.g. watermark level of
the FIFO, max delay of a sensor has exceeded; see section 11 for further details), the BHA will raise an
interrupt request to the host processor. The driver of the host processor can then fetch data from the
BHA FIFO.
Data will be delivered to the host as a single burst, starting with the events of the wake-up FIFO, followed
by the events of the non-wake-up FIFO, unless the output was triggered by a flush request, in which
case, the type of sensor requested in the flush determines which FIFO is delivered.
Meta events not related to a specific sensor will only be placed in the non-wakeup FIFO.
These meta events are
• Error
• Self-Test Results
• Initialized.
However, these meta events are enabled by default and they are configured by default to trigger host
interrupt request.
Meta events related to a specific physical sensor, such as the
• Sample Rate Changed
• Power Mode Changed
• Dynamic Range Changed
are always placed to the non-wakeup FIFO.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 31
Timestamps will be inserted in both FIFOs and maybe in a non-continuous manner, i.e. for certain
cases a timestamp with a lower value can follow a timestamp with a higher value.
9.10 Non-Batch Mode
Any sensor with zero latency or batching timeout will be reported as soon as it is detected. This will of
necessity result in many small FIFO transfers and an interrupt rate as high as the fastest non-batched
sensor’s sample rate. This may in reality be even more often than one might expect, due to slight
variations in sensor sample rates.
The host can minimize interrupts while ensuring timely transfer of sensor data by setting all but the
fastest enabled sensor to have non-zero latency, large enough to not timeout before the next sample of
the fastest sensor. In this configuration, data transfers from the FIFO will occur at the rate of the fastest
sensor, with all slower sensors transferred together.
For example, if the Accelerometer is set for 60 Hz, and the Gyroscope and Magnetometer are set to 20
Hz, and the Gyroscope and Magnetometer are each set with a latency timeout of 50 ms, host transfers
will occur like this:
1. Accel 1
2. Accel 2
3. Accel 3, Gyro 1, Mag 1
4. Accel 4
5. Accel 5
6. Accel 6, Gyro 2, Mag 2
7. …
9.11 Batch Mode
The BHA fully supports Android Lollipop & Marshmallow (non-HiFi) batching requirements. Each sensor
type has an independently settable latency or batching timeout.
The batched sensor data and other meta data is stored in a RAM-based FIFO. The size of the FIFO
depends on the remaining available RAM after uploading of the RAM patch into the BHA.
The BHA implements a single shared wakeup FIFO for wakeup sensors, and a single shared nonwakeup FIFO for non-wakeup sensors. As such, whichever sensor’s batching timeout expires first will
cause all events in the FIFOs to be sent to the host.
The BHA supports a host-settable watermark value for each FIFO, which is used to ensure that batched
data is not lost due to FIFO overflow, when the AP is outside of the suspend mode.
When the host is in suspend mode, the non-wakeup FIFO is allowed to overflow. The BHA will discard
the oldest data to make room for new data as it arrives. As soon as the host leaves suspend mode, the
BHA will request a transfer of the entire contents of both FIFOs to the host.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 32
10. Register Map Description
10.1 Buffer_Out[0:49]
Register Address (0x00 .. 0x31) – Read only
This range of 8 bit registers is used for data transfers from the FIFO to the host. Access to this area
must be done in a specific manner as described in section 13. The general procedure is, however, that
the host must read the Bytes_Remaining register to determine the current number of pending bytes in
the FIFO and reads afterwards this amount of bytes from this Buffer_Out register area.
(0x00 .. 0x31) Bit
Name
Description
Bit 7..0
Buffer_out
These registers are used
as a freeform streaming
output buffer area for
reading FIFO data
10.2 FIFO_Flush
Register Address (0x32) – Read write
This allows the host to request that a single sensor’s FIFO (batch mode) be flushed, or all sensors.
This is an optional mechanism; if the host does not use this register, then the watermark, sensor
latency, and wakeup and non-wakeup FIFO interrupt disable bits, as well as which sensors are
enabled, determine when the host interrupt occurs and whether the data stream will include both the
wakeup and non-wakeup FIFOs.
(0x32) Bit
Name
Description
Bit 7..0
FIFO_Flush
Sensor ID, or special value
0xFF to flush all
Value
Name
Description
0x00
NOP
No operation
0xFF
FLUSH_ALL
flush all samples for both
FIFOs
FIFO_Flush - Enumerated Values
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 33
10.3 Chip_Control
Register (0x34) – Read write
This register provides bits that control fundamental behavior of the chip.
(0x34) Bit
Name
Description
Bit 7..2
-
(fixed to 0)
Bit 1
HOST_UPLOAD_ENABLE
controls the RAM patch
upload mechanism
Bit 0
CPU_RUN_REQUEST
controls whether the CPU
is running or not
(0x35) Bit
Name
Description
Bit 7..5
ALGORITHM_ID
Algorithm ID
Bit 4..2
HOST_IF_ID
Host Interface ID:
0 = Android K
1 = Android L (et sqq.)
Bit 1
ALGORITHM_STANDBY
Algorithm Standby will be
set to confirm that the
host’s previous write of a 1
to the Algorithm Standby
Request bit in the Host
Interface Control register
has taken effect.
Bit 0
RESET
Reset is set after power-on
reset or reset invoked by
means of the Reset
Request register.
ALGORITHM_ID - Enumerated Values
Value
Name
Description
0
BSX
Bosch Sensortec BSX
Fusion Library
10.4 Host_Status
Register (0x35) – Read only
Provides status information to the host.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 34
10.5 Int_Status
Register (0x36) – Read only
This provides an alternative way for the host to determine the host interrupt status of the device, if the
physical interrupt line is not used.
NOTE: the time at which the host interrupt was asserted can be queried via the Host IRQ Timestamp
parameter of the System parameter page.
The Host Interrupt bit reflects the state of the host interrupt GPIO pin.
The Wakeup and Non-Wakeup Watermark bits are set if the watermark for their respective FIFOs was
reached. The Wakeup and Non-Wakeup latency bits are set if a timeout on a sensor in their
respective FIFOs expired. The Wakeup and Non-Wakeup Immediate bits are set if a sensor event has
occurred which was configured with no latency.
(0x36) Bit
Name
Bit 7
Reserved
Bit 6
Non-Wakeup Immediate
Bit 5
Non-Wakeup Latency
Bit 4
Non-Wakeup Watermark
Bit 3
Wakeup Immediate
Bit 2
Wakeup Latency
Bit 1
Wakeup Watermark
Bit 0
Host Interrupt
Description
10.6 Chip_Status
Register (0x37) – Read only
This register reflects fundamental behavior of the chip during boot up.
(0x37) Bit
Name
Description
Bit 7..5
-
(fixed to 0)
Bit 4
NO_EEPROM
No EEPROM
Bit 3
FIRMWARE_IDLE
Firmware Idle (halted)
Bit 2
EE_UPLOAD_ERROR
EEUploadError
Bit 1
EE_UPLOAD_DONE
EEUploadDone
Bit 0
EEPROM_DETECTED
EEPROM Detected
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 35
10.7 Bytes_Remaining[0:1]
Registers (0x38 - 0x39) – Read only
This 2x 8 bit register pair indicates how many bytes are available in the FIFO buffer. It forms a 16 bit
value and shall be read in one access in order to get the correct result. The value can vary from the
size of the smallest single FIFO event (a sensor sample of other event type) to the combined size of
both FIFOs. The maximum FIFO sizes can be queried using the FIFO Control Parameter in the
System Parameter Page.
The value of this register pair is updated by the BHA only at the following times:
1. Immediately prior to asserting the host interrupt
2. Upon demand, i.e. after the host writes a 1 to the Update Transfer Count bit of the Host Interface
Control register.
During normal operation, i.e. when the host receives an interrupt from the BHA, the host should read
these Bytes_Remaining registers, and use the provided value to read the amount of bytes from the
FIFO.
If all bytes are read, the BHA will de-assert the host interrupt line, in order to acknowledge that all data
announced by the Bytes_Remaining register to the host, have been read.
If new data arrive in the FIFOs, while the host is reading the FIFO the BHA, will update the
Bytes_Remaining registers and reassert the host interrupt (depending on the configured settings for
creating a host interrupt). This could occur immediately after the acknowledge, or later in time.
(0x38 - 0x39) Bit
Name
Description
Bit 15..0
Bytes_Remaining
Available Bytes in FIFOs
10.8 Parameter_Acknowledge
Register (0x3A) – Read only
This register is used to acknowledge a parameter read/write request, from the host.
I.e. a host write to the Parameter_Page_Select and the Parameter_Request register.
The host should poll the Parameter_Acknowledge register, until it matches the Parameter_Request
register, or it indicates an error providing the value 0x80. The error value means that the requested
parameter page or parameter number is unsupported.
(0x3A) Bit
Name
Description
Bit 7..0
Parameter_Acknowledge
Parameter Acknowledge
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 36
10.9 Parameter_Read_Buffer[0:15]
Registers (0x3B .. 0x4A) – Read only
This 8 bit register area provides an interface to the host for reading requested parameter out of the
various BHA’s parameter pages.
NOTE: The Parameter_Read_Buffer register area is large enough to report an entire sensor status
structure in one transfer.
(0x3B .. 0x4A) Bit
Name
Description
Bit 7..0
Parameter Read Buffer
Parameter Read Buffer
10.10 GP[20:24]
Registers (0x4B .. 0x4F) – Read only
This is a read only register area available for custom specific extensions. They are all read-only from
the I2C host but writable from the Fuser Core MCU.
10.11 Parameter_Page_Select
Register (0x54) – Read write
This register is used to select a parameter page for read/write access.
The least significant nibble contains the parameter page number, described below.
The most significant nibble contains the desired transfer size in bytes.
If 0 is selected for the transfer size, the max values for the transfer size (16 bytes for reading, 8 bytes
for writing) are selected. The size will be limited to the max values, in case the host specifies larger
values.
(0x54) Bit
Name
Description
Bit 7..4
PARAMETER_SIZE
desired transfer size in
bytes or 0 for max size (16
bytes read, 8 bytes write)
Bit 3..0
PARAMETER_PAGE
parameter page number
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
PARAMETER_PAGE - Enumerated Values
Value
Page 37
Name
Description
0
PAGE_0
The host must write this
value, after finishing an
access on the Algorithm
Parameter Page, as an
Acknowledgment for the
BHA, that it is safe to copy
back the algorithm data
structures.
1
SYSTEM
This page contains
parameters which affect the
whole system, such as
meta event enables,
sensor status, FIFO
watermark control, etc.
2
ALGORITHM
This page contains all the
original algorithm
coefficients and knobs.
When this is first selected,
the CPU makes a safe
copy of all necessary
algorithm data structures
that may be modified using
Parameter I/O to this page.
3
SENSORS
This page contains
parameters for every
sensor (real or virtual), both
for reading their status and
for configuring their
operation.
12
CUSTOM_12
These can be used by
customers for any purpose.
See appendix A.
13
CUSTOM_13
These can be used by
customers for any purpose.
See appendix A.
14
CUSTOM_14
These can be used by
customers for any purpose.
See appendix A.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 38
10.12 Host_Interface_Control
Register (0x55) – Read only
This register can be used by the host in order to control miscellaneous features of the BHA250, as
described in the following table.
NOTE: Abort Transfer and Update Transfer Count bits do not auto-clear. It is up to the host to set
these two bits correctly every time it writes this register. However, due to possible race conditions, it
should not clear any of these bits immediately after setting.
(0x55) Bit
Name
Description
Bit 7
NON_WAKEUP_FIFO_HOST_INT
ERRUPT_DISABLE
Bit 6
REQUEST_SENSOR_SELF_TEST Is used by the host to
inform the BHA, that a selftest should be per-formed
when transitioning out of
standby. Any physical
sensor driver, that
implement self-test control,
will request it and report a
Self-Test Results meta
event with the results
Bit 5
AP_SUSPENDED
Bit 4
NED_COORDINATES
Bit 3
WAKEUP_FIFO_HOST_INTERRU
PT_DISABLE
Is a master interrupt
disable bit; setting this bit
de-asserts the host
interrupt and prevents
further interrupts, while
clearing this bit (the default
state) allows it to be
asserted whenever a
proper condition occur. This
controls interrupt
generation due to the
wakeup FIFO.
Bit 2
UPDATE_TRANSFER_COUNT
Can be used by the host to
request a new value to be
written to the Bytes
Remaining registers, such
that data that has arrived
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Affects the BHA behavior in
issuing a host interrupt.
When true, only wakeup
sensor events may wake
the AP. When false, any
sensor event may trigger a
host interrupt according to
the configured conditions.
Selects the North East
Down coordinate system
instead of the default
Android East North Up
(ENU) system
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 39
since the last time Bytes
Remaining was written,
and data that has been
removed, shall be
accounted for. However,
this does not extend the
length of any pending or
on-going transfer. It is
merely an approximation of
how much more there is in
the FIFO.
Bit 1
Bit 0
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
ABORT_TRANSFER
Indicates the host does not
intend to complete reading
out the FIFO; all pending
data is discarded, as well
as any partial sensor
sample that remains. The
host interrupt line is
deasserted and the Bytes
Remaining is set to 0. If
there is more data in the
FIFO, the BHA will soon
request another transfer. It
is up to the host to recover
properly from this request.
ALGORITHM_STANDBY_REQUES Requests the algorithm to
T
prepare itself to pause (if
required by the
implemented algorithm),
then shuts down all
sensors in order to save
power. When this bit is deasserted, any sensors
previously enabled by the
host will be restarted, and
the operation of the
algorithm will resume. This
is a simpler way to
temporarily conserve
power without requiring the
host to disable all active
virtual sensors individually.
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 40
10.13 GP[31:36]
Registers (0x56 .. 0x5B) – Read write
This is a read/write register area available for custom specific extensions. This range is writeable from
the I2C host and readable by the Fuser Core MCU.
10.14 Parameter_Write_Buffer[0:7]
Registers (0x5C .. 0x63) – Read write
This 8 bit register area provides an interface to the host for writing specific parameter into one of the
various BHA’s parameter sets.
In order to write a specific parameter, the host should follow the procedure as already written in the
description of the Parameter_Read_B uffer.
NOTE: The configuration data for each sensor takes 8 bytes.
(0x5C .. 0x63) Bit
Name
Description
Bit 7..0
Parameter_Write_Buffer
Parameter Write Buffer
area
10.15 Parameter_Request
Register (0x64) – Read write
This register is used to read or write parameter from or to the BHA. In order to read or write a specific
parameter set, the host should follow the procedure as already written in the description of the
Parameter_Read_Buffer.
NOTE: Having the Parameter Acknowledge reset to 0, allows the host to determine on the next
parameter I/O request whether the request was successful.
(0x64) Bit
Name
Description
Bit 7
Request
Direction of the operation
Bit 6..0
Parameter
Parameter page select for
saving or writing
Value
Name
Description
0
Read
Read parameter page
1
Write
Write parameter page
Request - Enumerated Values
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 41
10.16 GP[46:52]
Registers (0x65 .. 0x6B) – Read write
This is a read/write register area available for custom specific extensions. This block is writeable by
the I2C host and readable by the Fuser Core MCU.
10.17 ROM_Version[0:1]
Registers (0x70 - 0x71) – Read only
This 2x 8 bit register pair contains the software version number corresponding to the code placed in
ROM and in the RAM firmware patch, if any. If none is present, this will read back 0.
(0x70 - 0x71) Bit
Name
Description
Bit 15..0
Rom_Version
ROM version number
Value
Name
Description
0x2112
FUSER1_C2
FUSER1_C2 BHA250
0x2DAD
FUSER1_C3
FUSER1_C3 BHA250B
Rom_Version – Enumerated Values
10.18 RAM_Version[0:1]
Registers (0x72 - 0x73) – Read only
This 2x 8 bit register pair contains the software version number corresponding to the RAM firmware
patch, if any. If none is present, this will read back 0.
(0x72 - 0x73) Bit
Name
Description
Bit 15..0
Ram_FW_Version
RAM patch number
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 42
10.19 Product_ID
Register (0x90) – Read only
This contains the product number of the device.
(0x90) Bit
Name
Bit 7..0
Product_ID
Description
Product_ID - Enumerated Values
Value
Name
Description
0x83
FUSER1_C2
FUSER1_C2, BHA250
0x83
FUSER1_C3
FUSER1_C3, BHA250B
(0x91) Bit
Name
Description
Bit 7..0
Revision_ID
10.20 Revision_ID
Register (0x91) – Read only
This identifies the hardware revision for the chip.
Revision_ID - Enumerated Values
Value
Name
Description
0x01
val_0x01, di01
FUSER1_C2 BHA250
0x03
val_0x03, di03
FUSER1_C3, BHA250B
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 43
10.21 Upload_Address[0:1]
Register (0x94) – Read write
This 16 bit register lets the host specify the starting address for a RAM patch. By default it is 0. After
a RAM upload, it will not be 0, so a subsequent RAM upload procedure will need to start by writing this
to 0.
As an exception, this register is Big Endian (i.e. MSB on address 0x94, LSB on address 0x95).
(0x94) Bit
Name
Description
Bit 7..0
Upload_Address_12_8
Upload Address
(0x95) Bit
Name
Description
Bit 7..0
Upload_Address_7_0
Upload Address
10.22 Upload_Data
Register (0x96) – Read write
Once the host has entered upload mode by writing a 1 to the Host Upload Enable bit of the Chip
Control register, it may burst the RAM image to this register.
NOTE: The RAM patch file format starts with a 16 byte header which must be skipped. Every 4 bytes
of data in the file after the header must be byte swapped before upload to this register.
(0x96) Bit
Name
Description
Bit 7..0
Upload_Data
Upload Data
10.23 Upload_CRC[0:3]
Registers (0x97 .. 0x9A) – Read only
After the host has transferred all data from the RAM patch file via the Upload Data register into the
BHA, the Data CRC register will contain a 32 bit CRC of the data. The host should compare this to a
calculated CRC to determine whether the upload was successful.
If the upload was successful, the host should disable upload mode and start firmware execution by
writing a 0 to the Host Upload Enable bit and a 1 to the CPU Run Request bit of the Chip Control
register.
(0x97 .. 0x9A) Bit
Name
Description
Bit 7..0
Data_CRC
Data CRC
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 44
10.24 Reset_Request
Register (0x9B) – Read write
The host writes a 1 to this register to trigger a hardware reset of the BHA’s internal CPU. This bit
automatically clears to 0.
(0x9B) Bit
Name
Description
Bit 7..0
Reset_Request
Reset Request
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 45
11. Parameter I/O Description
Except for a few features which the host can request using the Chip Control and Host Interface Control
registers, or which it can query from other registers, the primary control channel for configuring and
querying the state of the system and the sensors is done using Parameter I/O.
Parameter I/O in the BHA is implemented using a mail box protocol. This protocol includes a full
handshake between the host and the BHA to synchronize access to the data transfer registers; these
registers are used to carry control information to the BHA from the host or status information to the host
from the BHA.
The following sections describe the parameter pages, relevant to the user of the BHA.
11.1 Parameter Page 1: System
These parameters control general system-wide features.
Status banks 0 and 1 are for the non-wakeup sensors, and 2 and 3 are for the wakeup sensors.
Meta Event Control parameter 1 is for non-wakeup FIFO meta events, and Meta Event Control
parameter 29 is for wakeup FIFO meta events.
Table 14: Parameter Page 1 - System
Parameter Name
Read Data Buffer
Parameter
Number
1
2
3
Meta Event Control
FIFO Control
Sensor Status Bank 0
4
Sensor Status Bank 1
5
Sensor Status Bank 2
6
Sensor Status Bank 3
7-28
29
Reserved
Meta Event Control for
Wakeup FIFO
Host IRQ Timestamp
Physical Sensor Status
30
31
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Write Data Buffer
Status Bits
Sensors 1-16
Status Bits
Sensors 17-32
Status Bits
Sensors 33-48
Status Bits
Sensors 49-64
Not used
Physical Sensor
Status
Not used
Not used
Not used
Not used
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 46
Meta Event Control
The 8 bytes in this writeable parameter will be divided into two bit sections. Each section controls
whether the corresponding Meta Event will be enabled (so that it will appear in the output FIFO when it
occurs), as well as whether that will lead to an immediate host interrupt.
The MSB in each Bit Range is the event enable, and each LSB is the event interrupt enable.
Load
Parameter Byte
0
0
0
0
…
7
7
7
7
Table 15:Meta Event Control
Enable Bit
Int Enable Bit
1
3
5
7
0
2
4
6
1
3
5
7
0
2
4
6
Meta Event
Meta Event
Meta Event
Meta Event
Meta Event
Meta Event
Meta Event
Meta Event
Meta Event
1
2
3
4
29
30
31
32
FIFO Control
This parameter provides a mechanism for the host to set a target number of bytes the Wakeup FIFO
buffer and/or the Non-Wakeup FIFO buffer should contain before they assert the host interrupt signal.
Set this value to 0 to disable this feature, or a non-zero value to set the watermark. Any value larger
than the size of the FIFO will be treated the same as a value exactly equal to the size of the FIFO.
Data loss will likely occur with watermark values that are too high. It is up to the customer to determine,
in their application, based on the maximum I2C host rate and host interrupt response time, what a safe
maximum watermark level might be.
NOTE: a non-zero Watermark has no effect if all enabled sensors have 0 latencies (batch timeouts)
and the AP is active (the Host Interface Control register’s AP Suspend bit is 0). As soon as any one
sensor generates a sample, and that sensor’s latency is 0, a host interrupt will be generated. The
Watermark is only useful when all enabled continuous output sensors are configured with non-zero
latencies, or the AP is suspended, and no wakeup events occur.
The size of the FIFO can be retrieved by the host by reading this same parameter; it is returned in bytes
2 and 3 for the Wakeup FIFO and bytes 6 and 7 for the Non-Wakeup FIFO. This size is determined at
compile time of the RAM patch; additions of customer code or additional features or bug fixes will reduc e
the amount of RAM available for the FIFOs.
Parameter
Byte
0
1
2
3
4
5
6
7
FIFO
Wakeup
Non-Wakeup
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Table 16:FIFO Control
Field Name
Watermark LSB
Watermark MSB
FIFO Size LSB
FIFO Size MSB
Watermark LSB
Watermark MSB
FIFO Size LSB
FIFO Size MSB
Description
Direction
Number of bytes in FIFO
before interrupt is asserted
Size of FIFO in bytes
Read/write
Number of bytes in FIFO
before interrupt is asserted
Size of FIFO in bytes
Read/write
Read only
Read only
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 47
Sensor Status Banks
Each byte in a 16 byte Sensor Status Bank corresponds to a specific sensor type, starting with 1 (since
sensor type 0 is reserved).
Table 17:Sensor Status Bank
Sensor Status
Saved
Sensor Type
Bank
Parameter Byte
0
0
Sensor Type 1
0
…
0
15
Sensor Type 16
1
0
Sensor Type 17
1
…
1
15
Sensor Type 32
2
0
Sensor Type 33
2
…
2
15
Sensor Type 48
3
0
Sensor Type 49
3
…
3
15
Sensor Type 64
Each of these bytes contains the Sensor Status Bits for a given sensor. These reflect various pieces of
information about a sensor that used to be scattered among a number of different registers.
Bit
0
1
2
3
4
5-7
Table 18:Sensor Status Bits
Field Name
Description
Data Available
One or more samples in output buffer
I2C NACK
Sensor did not acknowledge transfer
Device ID Error
WHO_AM_I register mismatch
Transient Error
e.g., magnetic transient
Data Lost
FIFO overflow
Sensor Power Mode
Shutdown, standby, low power active,
high power active
The Sensor Power Mode values in bits 5-7 are:
0: Sensor Not Present
1: Power Down
2: Suspend
3: Self-Test
4: Interrupt Motion
5: One Shot
6: Low Power Active
7: Active
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 48
Timestamps
In order to provide a mechanism for the host to translate sensor data timestamps to host-relative
timestamps, this parameter may be read to determine the time at which the last host-interrupt was
asserted, as well as the current system time.
NOTE: the Host IRQ Timestamp can be read more efficiently from the Host IRQ Timestamp registers
0x6C-0x6F.
Table 19:Timestamp Data
Parameter Byte
Field Name
Description
Direction
0
Host IRQ Timestamp LSB
Time (in units of
1
Host IRQ Timestamp B2
1/32000 seconds) that
the last host interrupt
2
Host IRQ Timestamp B3
was triggered
3
Host IRQ Timestamp MSB
4
Current Timestamp LSB
Time
(in
units
of
Read only
5
Current Timestamp B2
1/32000 seconds) for
current
system
time
6
Current Timestamp B3
7
Current Timestamp MSB
Physical Sensor Status
This parameter is provided for debugging. The host can read the current underlying physical sensor
settings such as sample rate, dynamic range, interrupt enable, and power mode.
Parameter
Byte
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Field Name
Table 20: Physical Sensor Status
Type
Description
Accel Sample Rate
Unsigned 16 bit
Actual sample rate in Hz
Accel Dynamic
Range
Accel Flags
Unsigned 16 bit
Actual dynamic range in gs
Unsigned 8 bit
Unsigned 16 bit
bit 0: interrupt enable
bits 5-7: Sensor Power Mode (same as
Sensor Status Bits 5-7)
Actual sample rate in Hz
Gyro Dynamic
Range
Gyro Flags
Unsigned 16 bit
Actual dynamic range in gs
Unsigned 8 bit
Mag Sample Rate
Unsigned 16 bit
bit 0: interrupt enable
bits 5-7: Sensor Power Mode (same as
Sensor Status Bits 5-7)
Actual sample rate in Hz
Mag Dynamic Range
Unsigned 16 bit
Actual dynamic range in gs
Mag Flags
Unsigned 8 bit
bit 0: interrupt enable
bits 5-7: Sensor Power Mode (same as
Sensor Status Bits 5-7)
Gyro Sample Rate
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 49
Physical Sensors Present
This parameter contains a 64 bit bitmap, where a set bit indicates the corresponding physical sensor is
present in the system.
For example, if a physical accelerometer, magnetometer, and humidity sensor were the only physical
sensors present, the bit map would have bits set for sensor ID 1 (accelerometer), 2 (magnetometer)
and 12 (humidity). In this example, the bit map would be:
Byte 0:
Byte 1:
Byte 2:
Byte 3:
Byte 4:
Byte 5:
Byte 6:
Byte 7:
0000
0001
0000
0000
0000
0000
0000
0000
0110
0000
0000
0000
0000
0000
0000
0000
(binary; left most bit is bit 7, right most is bit 0)
(left most is bit 15; right most is bit 8)
Physical Sensor Information
This structure is returned for any parameters 33-96 when the corresponding physical sensor is
present. If not present, this structure returns all 0s.
This is an enhanced version of the earlier Physical Sensor Status structure. This new structure also
provides access to the orientation matrix, for those sensors that include them, such as 3 axis
accelerometers, magnetometers, and gyroscopes.
Parameter
Byte
0
Field Name
Table 21: Physical Sensor Information
Type
Description
Sensor Type
Unsigned 8 bit
1
Driver ID
Unsigned 8 bit
2
Driver Version
Unsigned 8 bit
3
4-5
Current
Current Range
Unsigned 8 bit
Unsigned 16 bit
Flags
Unsigned 8 bit
Reserved
Current Rate
Number of Axes
Unsigned 16 bit
Unsigned 8 bit
Orientation Matrix
4 bits per element
6
7
8-9
10
11-15
Same as parameter
number - 32
Unique per driver / vendor /
part number
Denotes notable change in
behavior
0.1 mA
Current dynamic range of
sensor in SI units
Bit 0: IRQ enabled
Bits 1-4: reserved
Bits 5-7: power mode
(see 5.1.3)
Current Sample Rate in Hz
Number of Axes
(e.g., X/Y/Z = 3)
See below
The matrix is used to align the orientation of physical sensor axes to match the required ENU (east north
up) orientation required by Android. The calculation is performed as:
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 50
The calibration matrix is output in the same order as the elements are listed in the board .cfg file used
to generate a firmware image (.fw file). Each matrix element is stored in successive nibbles.
For example, if the board .cfg file contains:
#DriverID,Addr,GPIO,C0,C1,C2,C3,C4,C5,C6,C7,C8,Off0,Off1,Off2,Range
a9, 24, 3, 1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0
Then bytes 11-15 of the Physical Sensor Information structure would be:
Byte 11: 01 (hexadecimal)
Byte 12: 00
Byte 13: 0F
Byte 14: 00
Byte 15: 0F
Bytes 11-15 would show the same result if the stuffelf utility were used to generate the .fw file by using
the command line: stuffelf outerloop.elf –a -d24 -p3 -c1,0,0,0,-1,0,0,0,-1
There are several possibilities to adjust the orientation matrix according to the needs of the
application, all covered within a separate application note. For details please refer to section 14.2.
11.2 Parameter Page 3: Sensors
The table below is split into two logical areas: Access to the Sensor Information structure, which is
read only, and access to the Sensor Configuration structure which is readable and writeable.
The results of a read access are provided in the Parameter_Read_Buffer, while the input for a write
access has to be provided in the Parameter_Write_Buffer.
The table describes, how to address the individual Information structures, whil the next 2 following
sections provide detailed information on these structures.
In the first area, Config Numbers 1-31, is for reading the Sensor Information structure of a specific nonwakeup sensor. Config Numbers 33-63, is for reading the Sensor Information structure of a specific
wakeup sensor.
In the second area, Config numbers 65-95, is for writing the Sensor Configuration structure of a specific
non-wakeup sensor, or for reading the actual sample rates, latencies, dynamic ranges, and sensitivities.
Config numbers 97-127, is for writing the Sensor Configuration structure of a specific wakeup sensor or
for reading the actual settings.
NOTE: The index can be calculated as: Sensor ID + (32 if wakeup) + (64 if Sensor Configuration). In
other words, the Config Number bits 0-4 specify Sensor ID; bit 5 specifies wakeup if 1, non-wakeup if 0;
and bit 6 specifies Sensor Information if 0, Sensor Configuration if 1.
Config
Number
1
2
3
4
5
6
7
8
Table 22: Parameter Page 3 - Sensors
Config Name
Value in
Parameter_Read_Buffer
Non-Wakeup Sensor Information
Accelerometer
Sensor Information
Structure
Geomagnetic Field
Sensor Information
Orientation
Sensor Information
Gyroscope
Sensor Information
Light
Sensor Information
Pressure
Sensor Information
Temperature
Sensor Information
Proximity
Sensor Information
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Value in
Parameter_Write
_Buffer
Not used
Not
Not
Not
Not
Not
Not
Not
used
used
used
used
used
used
used
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26-30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58-62
63
64
65
66
67
68
69
70
Gravity
Sensor Information
Linear Acceleration
Sensor Information
Rotation Vector
Sensor Information
Humidity
Sensor Information
Ambient Temperature
Sensor Information
Magnetic Field Uncalibrated
Sensor Information
Game Rotation Vector
Sensor Information
Gyroscope Uncalibrated
Sensor Information
Significant Motion
Sensor Information
Step Detector
Sensor Information
Step Counter
Sensor Information
Geomagnetic Rotation Vector
Sensor Information
Heart Rate
Sensor Information
Tilt Detector
Sensor Information
Wake Gesture
Sensor Information
Glance Gesture
Sensor Information
Pick Up Gesture
Sensor Information
Reserved
Activity Recognition
Sensor Information
Wakeup Sensor Information
Reserved
Accelerometer
Sensor Information
Geomagnetic Field
Sensor Information
Orientation
Sensor Information
Gyroscope
Sensor Information
Light
Sensor Information
Pressure
Sensor Information
Temperature
Sensor Information
Proximity
Sensor Information
Gravity
Sensor Information
Linear Acceleration
Sensor Information
Rotation Vector
Sensor Information
Humidity
Sensor Information
Ambient Temperature
Sensor Information
Magnetic Field Uncalibrated
Sensor Information
Game Rotation Vector
Sensor Information
Gyroscope Uncalibrated
Sensor Information
Significant Motion
Sensor Information
Step Detector
Sensor Information
Step Counter
Sensor Information
Geomagnetic Rotation Vector
Sensor Information
Heart Rate
Sensor Information
Tilt Detector
Sensor Information
Wake Gesture
Sensor Information
Glance Gesture
Sensor Information
Pick Up Gesture
Sensor Information
Reserved
Activity
Sensor Information
Non-Wakeup Sensor Configuration
Reserved
Accelerometer
Actual Configuration
Geomagnetic Field
Actual Configuration
Orientation
Actual Configuration
Gyroscope
Actual Configuration
Light
Actual Configuration
Pressure
Actual Configuration
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Page 51
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
Not used
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
Not
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
used
Not used
New
New
New
New
New
New
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90-94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122-126
127
Temperature
Actual Configuration
Proximity
Actual Configuration
Gravity
Actual Configuration
Linear Acceleration
Actual Configuration
Rotation Vector
Actual Configuration
Humidity
Actual Configuration
Ambient Temperature
Actual Configuration
Magnetic Field Uncalibrated
Actual Configuration
Game Rotation Vector
Actual Configuration
Gyroscope Uncalibrated
Actual Configuration
Significant Motion
Actual Configuration
Step Detector
Actual Configuration
Step Counter
Actual Configuration
Geomagnetic Rotation Vector
Actual Configuration
Heart Rate
Actual Configuration
Tilt Detector
Actual Configuration
Wake Gesture
Actual Configuration
Glance Gesture
Actual Configuration
Pick Up Gesture
Actual Configuration
Reserved
Activity
Actual Configuration
Wakeup Sensor Configuration
Reserved
Accelerometer
Actual Configuration
Geomagnetic Field
Actual Configuration
Orientation
Actual Configuration
Gyroscope
Actual Configuration
Light
Actual Configuration
Pressure
Actual Configuration
Temperature
Actual Configuration
Proximity
Actual Configuration
Gravity
Actual Configuration
Linear Acceleration
Actual Configuration
Rotation Vector
Actual Configuration
Humidity
Actual Configuration
Ambient Temperature
Actual Configuration
Magnetic Field Uncalibrated
Actual Configuration
Game Rotation Vector
Actual Configuration
Gyroscope Uncalibrated
Actual Configuration
Significant Motion
Actual Configuration
Step Detector
Actual Configuration
Step Counter
Actual Configuration
Geomagnetic Rotation Vector
Actual Configuration
Heart Rate
Actual Configuration
Tilt Detector
Actual Configuration
Wake Gesture
Actual Configuration
Glance Gesture
Actual Configuration
Pick Up Gesture
Actual Configuration
Reserved
Activity
Actual Configuration
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Page 52
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
New Configuration
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
New
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
Configuration
New Configuration
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 53
11.3 Sensor Information Structure
This structure reports everything that Android needs to know about a sensor type. If the requested
sensor is not supported by the current firmware image, then all fields must be reported as zero.
For physical sensors, the Max Range field will be set to the maximum possible range that the sensor
can attain if set to its highest range setting. This is a constant value that does not change based on the
current Dynamic Range setting. It is stored in Android-appropriate units (m/s 2, radians/s, µT). As this
is a 16 bit integer field, the value is rounded up to the next nearest integer.
The Resolution field is provided so that the host can determine the “smallest difference between two
values reported by this sensor.” It contains the number of bits of resolution. With that, the host can
determine the floating point resolution value in SI units by dividing the Max Range or current Dynamic
Range (in SI units) by 2Resolution.
Parameter
Byte
0
Table 23: Sensor Information Structure
Field Name
Type
Sensor Type
Unsigned 8 bit
1
2
3
4
5
Driver ID
Driver Version
Power
Max Range
Unsigned 8 bit
Unsigned 8 bit
Unsigned 8 bit
Unsigned 16 bit
6
7
8
9
10
11
Resolution
Unsigned 16 bit
Max Rate
Unsigned 16 bit
FIFO Reserved
Unsigned 16 bit
12
13
14
FIFO Max
Unsigned 16 bit
Event Size
8 bit
15
Min Rate
Unsigned 8 bit
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
Description
Defensive programming measure –
repeat the requested sensor type
NOTE: bit 4 of Sensor Type is 1 for
Non-Wakeup sensors
Unique per driver / vendor / part number
Denotes notable change in behavior
0.1 mA/LSB
Maximum range of sensor data in SI
units
Number of bits of resolution of
underlying sensor
Hz
FIFO size in bytes reserved for this
sensor divided by data packet size in
bytes; if a single shared FIFO, this can
be 0
Entire FIFO size in bytes divided by
data packet size in bytes
Number of bytes for sensor data packet
(including Sensor Type)
Hz
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 54
11.4 Sensor Configuration Structure
The following table describes the parameter set of the sensor configuration structure:
Parameter
Byte
0
1
2
3
4
5
6
7
Field Name
Table 24: Sensor Configuration Structure
Type
Sample Rate
Unsigned 16 bit
Max Report
Latency
Unsigned 16 bit
Change
Sensitivity
Dynamic Range
Unsigned 16 bit
Unsigned 16 bit
Description
Rate in Hz; 1 ÷ Android sample period;
reads back actual sensor rate
0 for non-batch mode; if nonzero,
Sample Rate must also be nonzero;
milliseconds; reads back actual latency
Scaled same as sensor’s data value; for
future Win8/10 support
range setting for physical setting in
appropriate units
The meaning of each field below is slightly different depending on whether this is being written or read;
see the description for details.
Changes to the Sample Rate field take effect quickly, but not immediately. If the host wishes to know
when the rate change is complete, it can enable and wait for the Sample Rate Changed meta event.
The actual rate selected is within the range of 90% ... 210% of the requested range.
Changes to the Max Report Latency take effect immediately. If a timer for the sensor using a different
Max Report Latency is running, it will be modified. It is possible due to timing for a change to be slightly
too late to effect the current timer, but will affect subsequent samples. If Max Report Latency is set to 0
when it was previously not 0, then this will be treated the same as a flush request.
The Dynamic Range field for the virtual Accelerometer, Gyroscope, and Magnetometer sensors will be
able to control the actual dynamic range settings in the corresponding physical sensors. A value of 0
requests the default. The algorithm will be informed of the request to change the dynamic range, and,
the corresponding scale factor for the sensor data outputs will change accordingly. The host may then
read back the Sensor Configuration structure to determine the actual current dynamic range.
NOTE: the host should enable and watch for the Dynamic Range Changed meta event so it can apply
the correct scale factor before and after the dynamic range change, if the change is made while the
sensor is already enabled.
Reading back the parameter is especially important if the host sets a dynamic range for other virtual
sensors that share the same underlying physical sensor. The BHA will select the largest requested
dynamic range of all virtual sensors that share that physical sensor.
For instance, the virtual Accelerometer, Gravity, and Linear Acceleration sensors all share the physical
accelerometer. The virtual Gyroscope and Uncalibrated Gyroscope both share the physical gyroscope.
The virtual Magnetometer and Uncalibrated Magnetometer share the physical magnetometer. If the
host does not specify a dynamic range for a specific virtual sensor (by setting it to 0), then only the virtual
sensors with non-zero dynamic range requests from the host will be considered in selecting the actual
dynamic range for the physical sensor.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 55
For example, setting the dynamic range for the Accelerometer sensor to 156.93 m/s 2 while setting the
dynamic range of the Linear Acceleration sensor to 78.46 m/s 2 and the Gravity sensor to 0 results in an
actual dynamic range for all three sensors as well as the physical sensor of 156.93 m/s 2, which is the
same as 16 Earth g-s.
The dynamic range will determine the scale factor for the sensor data, based on the number of bits and
signed-ness of the data.
The units of measurement for dynamic range here are not the same as the Android units for those
sensors. We have chosen to use units that are commonly used by sensor manufacturers in their data
sheets when discussing range settings.
1. Accelerometer: Earth g-s
2. Gyroscope: degrees/second
3. Magnetometer: µT
11.5 Parameter Page 15: Soft Pass-Through
This parameter page can be used during normal operation to read and write registers on devices
attached to the sensor I2C bus.
Parameter 1: Soft Pass-Through register read single multi-byte transfer
Parameter 3: Soft Pass-Through register read multiple single byte transfers
Parameter 5: Soft Pass-Through register read multiple single byte transfers with 0.5ms delays
Table 25: Parameter Page 15 – Soft-Pass-Through 1
Parameter Byte
Parameter Name
Description
0
I2C Slave address
Slave address for the sensor
1
Start Register
The first register address to read
2
Read Length
Register length to read (maximum 4)
3
Completion Status
To judge if the register read has finished
4
Reg Value Byte 1
Returned register value
5
Reg Value Byte 2
Returned register value
6
Reg Value Byte 3
Returned register value
7
Reg Value Byte 4
Returned register value
On read bytes 1 through 3 returns the last time value written for validation purpose.
Direction
Read/Write
Read/Write
Read/Write
Read
Read
Read
Read
Read
Parameter 2: Soft Pass-Through register write single multi-byte transfer
Parameter 4: Soft Pass-Through register write multiple single byte transfers
Parameter 6: Soft Pass-Through register write multiple single byte transfers with 0.5ms delays
Parameter Byte
0
1
2
3
4
5
6
7
Table 26: Parameter Page 15 – Soft-Pass-Through 2
Parameter Name
I2C Slave address
Start Register
Write Length
Completion Status
Reg Value Byte 1
Reg Value Byte 2
Reg Value Byte 3
Reg Value Byte 4
Description
Slave address for the sensor
The first register address to write
Register length to write (maximum 4)
To judge if the register write has finished
Register value to write
Register value to write
Register value to write
Register value to write
Direction
Read/Write
Read/Write
Read/Write
Read
Write
Write
Write
Write
On read bytes 1 through 3 returns the last time value written for validation purpose. On write bytes 3 is
ignored.
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 56
Parameters 1 and 2 perform fast single transfers of multiple bytes. Some sensor devices do not support
this. Alternatively, parameters 3 and 4 simulate a multi byte transfer by doing a series of single byte
transfers with an incrementing register address; this is useful for some devices that do not support multibyte transfers. Finally, parameters 5 and 6 are similar to 3 and 4, except a delay of 0.5ms is added
between each byte transfer. Some sensors require slow writes in certain modes, for example.
Completion
• 0=
• 1=
• 2=
status values:
transfer in progress (or none ever issued yet)
transfer successful
I2C NACK or I2C error
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 57
12. Sensor Data Types and Output Format
Sensor IDs will match the Android numbering; these are currently numbered 1 through 31. Any new
sensor IDs that represent unique custom sensors will be numbered starting at 254, decreasing towards
the Android numbers.
If the host and BHA become out of sync, the host can regain synchronization by flushing the buffer
(reading everything in it). Any data that arrives after that will start with a whole sensor data packet, with
the Sensor Type as the first byte.
Sensor Sensor Size
ID Non
ID
in
Wakeup Wakeup FIFO
1
Table 27: Sensor IDs, Data Types and Output Format
Contents
Scale Factor
Sensor Value
Padding
11
15
20
43
47
52
11
1
2
3
4
9
10
5
8
12
33
34
35
36
41
42
37
40
44
8
19
7
13
51
39
45
3
3
Step Counter
Temperature
Ambient Temperature
6
38
4
Barometer
17
18
22
23
24
25
14
16
49
50
54
55
56
57
46
48
2
Significant Motion
Step Detector
Tilt Detector
Wake Gesture
Glance Gesture
Pick Up Gesture
Uncalibrated Magnetometer
Uncalibrated Gyroscope
None
Event
dynamic
dynamic
Uncalib X, Y, Z;
bias X, Y, Z
Status
21
53
Heart Rate
None
Scalar
3
14
2
Rotation Vector
Game Rotation Vector
Geomagnetic Rotation Vector
214
Accelerometer
Magnetometer
Orientation*
Gyroscope
Gravity
Linear Acceleration
Light
Proximity
Humidity
dynamic
dynamic
360 ° / 215
dynamic
dynamic
dynamic
10000Lux /
216
100cm / 216
1%RH
None
500LSB/°C
centered at
24°C
1/128 Pa
BST-BHA250(B)-DS000-01 | Revision 1.2 | Mar 2017
X, Y, Z, W
Quaternion
Estimated Accuracy
(radians)
X, Y, Z Vector
Status
Absolute Scalar
Absolute Scalar
Scalar
Absolute Scalar
Format
Unsigned 8 bit value
0 means NOP
16 bit signed fixed
point
16 bit signed fixed
point integer
16 bit signed integer,
scaled to current
dynamic range;
8 bit unsigned integer
indicating accuracy of
measurement
16 bit unsigned
integer, scaled to
maximize dynamic
range
16 bit unsigned integer
16 bit signed integer,
scaled to maximize
dynamic range
24 bit unsigned
integer, scaled as
required
None
16 bit signed integer,
scaled to current
dynamic range
8 bit unsigned integer
indicating accuracy of
measurement (low,
medium, high,
unreliable)
8 bit beats per minute
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 preliminary and subject to change without notice.
BHA250(B)
Data sheet
Page 58
31
63
3
Activity
None
Scalar
245
n/a
14
Debug
None
Structure
249
250
251
n/a
17
BSX_C
BSX_B
BSX_A
252
246
3
Timestamp LSW
253
247
3
Timestamp MSW (Overflow)
254
248
4
Meta Events
Bits 0-7 specify the
activity change off, bits
8-15 specify the
activity change on; see
below for bit definitions
Byte 1:
Bit 7: reserved
Bit 6: binary fmt (string
if 0, binary if 1)
Bits 5-0: valid bytes
Bytes 2-13:
debug data
None
Accel, Gyro, Mag:
Accel, Gyro, Mag:
X, Y, Z, Timestamp 32 bit signed integer
(C=raw gyro, B=raw
mag, A=raw accel); 32
bit timestamp of
current sensor sample
1/32000
Time
16 bit unsigned
seconds
integer; counts at a
32KHz rate; applies to
all following sensor
samples; wraps every
2 seconds
65536/32000
Time
16 bit unsigned
seconds
integer; counts at
Timestamp overflow
rate; wraps every 36
hours
None
Event
8 bit unsigned integer
event number
8 bit unsigned integer
sensor type
8 bit unsigned integer
event-specific value
*NOTE: X = azimuth = 0° to 360° unsigned, Y = pitch = +/- 180° signed, Z = roll = +/- 90° signed
12.1 Quaternion+
For the three rotation vectors (Rotation Vector, Game Rotation Vector, Geomagnetic Rotation Vector),
the following format is used.
The host can convert the X, Y, Z, W, and Estimated Accuracy fields to floating point numbers like this:
unsigned char event[11];
… read in the event to the array above…
float x = ((float)(event[1] + ((unsigned int)event[2])