Data Sheet BHI160 / BHI160B Ultra low-power sensor hub incl. integrated IMU Bosch Sensortec Restricted Data Sheet Document revision 1.4 Document release date May 2019 Document number BST-BHI160B-DS000-03 Technical reference code(s) BHI160: 0 273 141 230 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. BHI160B: 0 273 141 309 BHI160(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 ultralow 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 3.0x3.0x0.95 mm3 LGA package with extension interface for additional sensors. Page 2 General Description The BHI160(B) is a small, low-power smart-hub with an integrated three axis gyroscope plus an integrated three axis accelerometer plus a programmable microcontroller. Containing preinstalled software and specific algorithms for activity recognition it is specifically designed to enable always-on motion sensing. It 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 best-in-class 6-axis IMU (BMI160) with an MCU - 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 on-board memory the BHI 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 Step-counting, indoor navigation, PDR HMI interfaces incl. gesture detection of motion, tilt, pickup, wake up, glance or other gestures for wearables Augmented reality, immersive gaming Tilt compensated eCompass Full 9DoF data fusion for highly accurate 3D orientation, quaternions, Euler angles, etc. 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 IMU only: Accelerometer, Gravity, Linear acceleration, Gyroscope, Gyroscope uncalibrated, Game rotation vector, Step counter, Step detector, Significant motion, Tilt detector, Pickup gesture, Wake up gesture, Glance gesture, Activity recognition With attached magnetometer: Geomagnetic field, Magnetic field uncalibrated, Orientation, Rotation vector, Geomagnetic rotation vector BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(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 ....................................................................................... 11 2. PIN CONNECTIONS AND DESCRIPTION......................................................................... 12 2.1 CONNECTION DIAGRAM ................................................................................................. 13 3. OVERVIEW .......................................................................................................................... 14 4. PHYSICAL INTERFACES ................................................................................................... 16 4.1 HOST INTERFACE .......................................................................................................... 16 4.2 SENSOR INTERFACE ...................................................................................................... 17 5. DATA INTERFACE .............................................................................................................. 18 5.1 GENERAL OVERVIEW ..................................................................................................... 18 5.2 REGISTER MAP ............................................................................................................. 19 6. DEVICE INITIALIZATION AND STARTUP ........................................................................ 21 6.1 RESET.......................................................................................................................... 21 6.2 BOOT MODE ................................................................................................................. 21 6.3 MAIN EXECUTION MODE ................................................................................................ 21 7. DEVICE CONFIGURATION ................................................................................................ 23 8. FIFOS AND EVENTS .......................................................................................................... 24 9. FUNCTIONAL DESCRIPTION ............................................................................................ 25 9.1 DATAFLOW OF SENSOR FUSION ..................................................................................... 25 9.2 SUPPORTED DATA RATES OF BSX SENSOR FUSION ENGINE ............................................ 25 9.3 GESTURE RECOGNITION ................................................................................................ 26 9.4 POWER MODES AND CURRENT CONSUMPTION ............................................................... 26 9.5 VIRTUAL SENSORS........................................................................................................ 27 9.6 VIRTUAL SENSOR DATA TYPES ...................................................................................... 29 9.7 SENSOR CONFIGURATION.............................................................................................. 30 9.8 SENSOR STATUS INFORMATION ..................................................................................... 31 9.9 FIFOS.......................................................................................................................... 32 9.10 NON-BATCH MODE ..................................................................................................... 33 9.11 BATCH MODE ............................................................................................................. 33 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 4 10. REGISTER MAP DESCRIPTION ...................................................................................... 34 10.1 BUFFER_OUT[0:49] .................................................................................................... 34 10.2 FIFO_FLUSH .............................................................................................................. 34 10.3 CHIP_CONTROL .......................................................................................................... 35 10.4 HOST_STATUS ........................................................................................................... 35 10.5 INT_STATUS ............................................................................................................... 36 10.6 CHIP_STATUS............................................................................................................. 36 10.7 BYTES_REMAINING[0:1] .............................................................................................. 37 10.8 PARAMETER_ACKNOWLEDGE ...................................................................................... 37 10.9 PARAMETER_READ_BUFFER[0:15] .............................................................................. 38 10.10 GP[20:24] ................................................................................................................ 38 10.11 PARAMETER_PAGE_SELECT ..................................................................................... 38 10.12 HOST_INTERFACE_CONTROL .................................................................................... 40 10.13 GP[31:36] ................................................................................................................ 42 10.14 PARAMETER_WRITE_BUFFER[0:7]............................................................................. 42 10.15 PARAMETER_REQUEST ............................................................................................. 42 10.16 GP[46:52] ................................................................................................................ 43 10.17 ROM_VERSION[0:1] ................................................................................................. 43 10.18 RAM_VERSION[0:1].................................................................................................. 43 10.19 PRODUCT_ID ........................................................................................................... 44 10.20 REVISION_ID ............................................................................................................ 44 10.21 UPLOAD_ADDRESS[0:1] ............................................................................................ 45 10.22 UPLOAD_DATA ......................................................................................................... 45 10.23 UPLOAD_CRC[0:3] ................................................................................................... 45 10.24 RESET_REQUEST ..................................................................................................... 46 11. PARAMETER I/O DESCRIPTION..................................................................................... 47 11.1 PARAMETER PAGE 1: SYSTEM ..................................................................................... 47 11.2 PARAMETER PAGE 3: SENSORS ................................................................................... 52 11.3 SENSOR INFORMATION STRUCTURE ............................................................................. 55 11.4 SENSOR CONFIGURATION STRUCTURE......................................................................... 56 11.5 PARAMETER PAGE 15: SOFT PASS-THROUGH .............................................................. 57 12. SENSOR DATA TYPES AND OUTPUT FORMAT .......................................................... 59 12.1 QUATERNION+ ............................................................................................................ 60 12.2 VECTOR+ ................................................................................................................... 61 12.3 VECTOR_UNCALIBRATED ............................................................................................ 62 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 5 12.4 SCALAR DATA ............................................................................................................. 62 12.5 SENSOR EVENT DATA (PARAMETERLESS SENSORS) ..................................................... 63 12.6 ACTIVITY RECOGNITION DATA (SENSOR_ACTIVITY_REC_DATA) .................................... 63 12.7 DEBUG ....................................................................................................................... 63 12.8 SENSOR DATA SCALING............................................................................................... 64 12.9 META EVENTS ............................................................................................................ 65 12.9.1 SELF-TEST RESULTS............................................................................................................. 66 12.9.2 INITIALIZED ........................................................................................................................... 67 13. READING FIFO DATA ...................................................................................................... 68 13.1 HOST INTERRUPT BEHAVIOR........................................................................................ 68 13.2 PAUSE AND RESUME MECHANISM ................................................................................ 69 13.3 FIFO OVERFLOW HANDLING........................................................................................ 70 13.4 HOST SUSPEND PROCEDURE ...................................................................................... 70 13.5 HOST WAKEUP PROCEDURE........................................................................................ 70 13.6 NON-COMPLIANT HOSTS ............................................................................................. 70 13.7 RECOVERY FROM LOSS OF SYNC ................................................................................. 71 13.8 PADDING DATA ........................................................................................................... 71 13.9 ABORTING A TRANSFER ............................................................................................... 71 13.10 FIFO PARSING EXAMPLES ......................................................................................... 71 13.10.1 ACCELEROMETER & STEP COUNTER .................................................................................... 71 14. PACKAGE ......................................................................................................................... 74 14.1 OUTLINE DIMENSIONS ................................................................................................. 74 14.2 SENSING AXES ORIENTATION AND AXIS REMAPPING ..................................................... 74 14.3 LANDING PATTERN RECOMMENDATION ......................................................................... 76 14.4 MARKING.................................................................................................................... 77 14.4.1 MASS PRODUCTION ............................................................................................................... 77 14.4.1 ENGINEERING SAMPLES ......................................................................................................... 77 14.5 SOLDERING GUIDELINES .............................................................................................. 78 14.6 HANDLING INSTRUCTIONS ............................................................................................ 79 14.7 TAPE AND REEL SPECIFICATION.................................................................................... 79 14.7.1 ORIENTATION WITHIN THE REEL.............................................................................................. 80 14.8 ENVIRONMENTAL SAFETY ............................................................................................ 80 14.9 HALOGEN CONTENT .................................................................................................... 80 14.10 MULTIPLE SOURCING ................................................................................................. 80 15. LEGAL DISCLAIMER........................................................................................................ 81 15.1 ENGINEERING SAMPLES............................................................................................... 81 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 6 15.2 PRODUCT USE ............................................................................................................ 81 15.3 APPLICATION EXAMPLES AND HINTS ............................................................................. 81 16. DOCUMENT HISTORY AND MODIFICATIONS .............................................................. 82 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(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 OPERATING CONDITIONS BHI Condition Min 1.71 Typ 1.8 Max 3.6 Unit V VDDIO 1.6 1.8 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 1.2 Electrical 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 0C TO +40C, (1) VREG125MV 800 V UA IOPER 0C TO +40C, (2) 300 UA ISLEEP 0C TO +40C, (3) 40 UA IDSLEEP 0C TO +40C, (4) 7 UA IIDLE 0C TO +40C, (5) 6 UA Notes: (1) Current consumption when CPU is running and executing from ROM. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(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 Acceleration Range gFS2g Selectable via serial digital interface Typ Max Units 2 g 4 g gFS8g 8 g gFS16g 16 g 3.2 ms gFS4g Start-up time Min tA,su Suspend/low power mode to normal mode OUTPUT SIGNAL ACCELEROMETER Parameter Symbol Condition Min Typ Resolution Sensitivity 1 Max Units 16 bit S2g gFS2g, TA=25C 16384 LSB/g S4g gFS4g, TA=25C 8192 LSB/g S8g gFS8g, TA=25C 4096 LSB/g S16g gFS16g, TA=25C 2048 LSB/g Sensitivity Temperature Drift TCSA gFS2g, Nominal VDD supplies best fit straight line 0.03 %/K Sensitivity change over supply voltage SA,VDD TA=25C, 0.01 %/V Zero-g Offset OffA, init gFS2g, TA=25C, nominal VDD supplies, component level 40 mg OffA,board gFS2g, TA=25C, nominal VDD supplies, soldered, board level 60 mg OffA,MSL gFS2g, TA=25C, nominal VDD supplies, after MSL1-prec. 1 / soldered 70 mg VDD,min VDD VDD,max best fit straight line Values taken from qualification, according to JEDEC J-STD-020D.1 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 9 OffA,life gFS2g, TA=25C, nominal VDD supplies, soldered, over life time2 150 mg Zero-g Offset Temperature Drift TCOA gFS2g, Nominal VDD supplies best fit straight line 1.0 mg/K Nonlinearity NLA Best fit straight line, gFS2g 0.5 %FS Output Noise nA,nd gFS2g, TA=25C, nominal VDD, Normal mode 180 g/Hz nA,rms Filter setting 80 Hz, ODR 200 Hz 1.8 mg-rms Cross Axis Sensitivity SA Relative contribution between any two of the three axes 1 % Alignment Error EA Relative to package outline 0.5 Output Data rate (set of x,y,z rate) ODRA Output Data rate accuracy (set of x,y,z rate) AODRA 12.5 1600 Normal mode, over whole operating temperature range 1 Hz % Table 4: Electrical characteristics gyroscope OPERATING CONDITIONS GYROSCOPE Parameter Symbol Condition Range RFS125 Selectable via serial digital interface Sensitivity 2 Typ Max Unit 125 /s 250 /s RFS500 500 /s RFS1000 1,000 /s RFS2000 2,000 /s RFS250 Start-up time Min tG,su Suspend to normal mode ODRG=1600Hz 55 ms tG,FS Fast start-up to normal mode 10 ms 16.4 LSB//s RFS2000 OUTPUT SIGNAL GYROSCOPE Ta=25C RFS1000 Ta=25C 32.8 LSB//s RFS500 Ta=25C 65.6 LSB//s Values taken from qualification, according to JEDEC J-STD-020D.1 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 10 RFS250 Ta=25C 131.2 LSB//s RFS125 Ta=25C 262.4 LSB//s Sensitivity change over temperature TCSG 0.02 %/K Sensitivity change over supply voltage SG,VDD RFS2000, Nominal VDD supplies best fit straight line TA=25C, 0.01 %/V 0.1 %FS Nonlinearity NLG g- Sensitivity Zero-rate offset Zero-Rate offset Over temperature Zero-rate offset change over temperature Output Noise Bias stability Output Data Rate (set of x,y,z rate) Output Data rate accuracy (set of x,y,z rate) Cross Axis Sensitivity Off x y and z Off x, oT y, oT and z,oT TCOG VDD,min VDD VDD,max best fit straight line Best fit straight line RFS1000, RFS2000 Sensitivity to acceleration stimuli in all three axis (frequency <20kHz) TA=25C, /s/g 3 /s fast offset compensation off -40C TA +85C 3 /s -40C TA +85C, 0.05 /s/K best fit straight line nG,nD @10 Hz 0.007 /s/Hz nG,rms Filter setting 74.6Hz, ODR 200 Hz 0.07 /s rms 3 /h BSG ODRG 25 AODRG Over whole operating temperature range XG,S Sensitivity to stimuli in non-sensedirection 3200 1 Hz % 2 % Table 5: Electrical characteristics temperature sensor OPERATING CONDITIONS AND OUTPUT SIGNAL OF TEMPERATURE SENSOR Parameter Symbol Temperature Sensor Measurement Range TS Condition Min Typ -40 Max Unit 85 C Temperature Sensor Slope dTS 0.002 Temperature Sensor Offset OTS 2 Output Data Rate ODRT Accelerometer on or Gyro in fast start-up 0.8 Hz Gyro active 100 Hz Resolution nT Accelerometer on or Gyro in fast start-up 8 Bit Gyro active 16 Bit BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 K/LSB 5 K Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 11 1.3 Absolute maximum ratings PARAMETER Voltage at Supply Pin Table 6: Absolute maximum ratings Condition Min 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 = 85C, 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, VDD to VDDIO, any other combination 1 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 12 2. Pin Connections and description Figure 1: Pin Connections Bottom view (Pads visible) Table 7: Pin description Pin Name 1 NC 2 DNC 3 4 5 6 GPIO1 RESV2 RESV3 NC 7 ASCK 8 VDDIO 9 SA_GPIO7 10 VREG 11 GPIO2 12 INT 13 14 15 16 17 18 19 20 VDD NC NC NC NC GND NC GNDIO 21 ASDA 22 RESV4 23 SCK I2C serial clock (Host interface) 24 SDA I2C serial data (Host interface) BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Description Not connected Do not connect (reserved) Application specific I/O pin Do not connect (reserved) Do not connect (reserved) Not connected I2C Master serial clock, for connection of external sensors Digital I/O power supply voltage (1.6 V ... 3.3 V) Select I2C address & Application specific I/O pin refer to section 4.1 page 16 Regulator filter capacitor connection Application specific I/O pin Host interrupt Analog power supply voltage (1.71 V...3.6 V) Not connected Not connected Not connected Not connected Analog power supply ground Not connected Digital I/O power supply ground I2C Master serial data, for connection of external sensors Do not connect (reserved) Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 13 2.1 Connection Diagram Figure 2: Reference Diagram For R3, R4 refer to below given note! BHI Table 8: Typical values for external circuit components Component 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 100 nF 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 14 3. Overview The BHI 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 MEMS With these integrated hardware and software features, the low power consumption and the sensor extension interface, the BHI provides an ideal all-in-one solution for always-on sensor applications. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 15 Without any additionally attached sensors the BHI provides a six degrees of freedom (6-DoF) inertial motion unit (IMU) measurement system out of the box, implementing the following Android 3 sensor types: Accelerometer Gravity Linear acceleration Gyroscope Gyroscope uncalibrated Game rotation vector Step counter Step detector Significant motion Tilt detector Pickup gesture Wake up gesture Glance gesture Activity recognition4 By attaching an external magnetometer to the sensor interface (and configuring the RAM firmware patch to include the sensor driver for the magnetometer) the BHI provides additionally the following sensor types: Geomagnetic field Magnetic field uncalibrated Orientation Rotation vector Geomagnetic rotation vector offering a full 9-DoF solution to the user. With further attachment of additional sensors to the sensor interface, as e.g. Barometic pressure Humidity Ambient temperature Proximity Ambient Light the BHI can provide the full Android sensor stack to the application. 3 See http://source.android.com/devices/sensors/sensor-types.html for details on defined Android Sensor Types. 4 Activity recognition is also implemented as a Sensor Type in BHI, despite not being defined in Android's "sensors.h", but in "activity_recognition.h". BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 16 4. Physical Interfaces 4.1 Host interface According to the interface concept introduced from Android 5 onwards, the BHI 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 I2C bus specification created from NXP5 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 BHI 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 I2C slave interface is always initiated by the host. The I2C slave interface can operate as either a transmitter or receiver only, if a valid device address has been received from the host. The BHI 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 9. 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 9: 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 BHI. 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: I2C write example Figure 4 illustrates an example of how to read data to registers in single-byte or multiple-byte mode. 5 See http://www.nxp.com/documents/user_manual/UM10204.pdf for details BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 17 Figure 5: I2C read example 4.2 Sensor interface The BHI implements a fast-mode plus I2C master interface for connections of external sensors. This sensor interface is directly connected to the internal BMI160 IMU sensor and also available on the auxiliary serial clock (ASCK) and auxiliary serial data (ASDA) pins of the BHI. 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 BMI160 IMU sensor. A common use-case of the sensor interface is the connection of an external magnetometer. The following external magnetometers are currently supported: Table 10: Supported Magnetometers Vendor Device Bosch Sensortec AKM Yamaha BMM150 AK09911/12 YAS532/537 Alternative magnetometers can be supported on customer request. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 18 5. Data interface 5.1 General overview Figure 5 provides a general overview of the BHI data interface. The software running on the Fuser core obtains the raw sensor from the I2C 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: 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 19 The Configuration Parameter I/O interface provides a window in the various configuration options of the sensor system. It consists of the 16 Byte deep Par_Read_Buffer (I2C addresses 0x3B:0x4A) and the 8 Byte deep Par_Write_Buffer (I2C 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 11: Register Map Register Name Access mode Map section 0x00 - 0x31 Buffer Out[00:49] Read only Sensor Data Buffer 0x32 FIFO Flush Read write Fuser Core Config & Status 0x33 Reserved 0x34 0x35 0x36 0x37 Chip Control Host Status Int Status Chip Status Read write Read only Read only Read only 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 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 (c) 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. BHI160(B) Data sheet 0x90 0x91 Product ID Revision ID 0x92 - 0x93 Reserved 0x94 - 0x95 0x96 0x97 - 0x9A 0x9B Page 20 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 21 6. Device Initialization and Startup The procedure in order to initialization and startup the BHI 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 BHI's interrupt, according to the defined conditions (see step 6). If the host receives an interrupt request from the BHI, 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 BHI 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 BHI first comes out of reset it executes the ROM boot loader. The boot loader performs the default initialization of the BHI, 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 BHI 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 BHI 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 22 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 23 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 BHI is offered through the Configuration Parameter I/O interface. The Configuration Parameter I/O interface, is provided through registers of the BHI and consists of Parameter_Read_Buffer[0:15] (0x3B - 0x4A) in order to read a specific parameter set out the BHI's config parameter area Parameter_Write_Buffer[0:7] (0x5C - 0x63) in order to write a specific parameter set into the BHI'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_Buffer 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_Select 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 24 8. FIFOs and Events Understanding the concept of FIFOs and Events is fundamental for proper operation of the BHI. Both elements are implemented into the device in order to meet the requirements of Android. Every piece of information the BHI delivers to the host is treated as an Event and placed into a FIFO. FIFOs BHI 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 BHI 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 BHI. 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 BHI'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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 25 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 n ACC FIFO1 n GRV n ... AP I2C 3.4M n ACC FIFO2 n GRV n ... BSX Sensor Fusion ACC Sensor Driver GYR GYR BMI160 Sensor Driver MAG MAG I2C 1M Virtual Driver BARO Sensor Driver BARO Virtual Driver HUMI Sensor Driver HUMI HUMI Sensor Driver ... ... Virtual Driver ... FUSER Sensor Driver ACC (customer ext) BARO BHI160 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 12: 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 requirements 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 26 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 BHI allows individual gestures to be implemented and mapped on the above mentioned system gestures. By default the firmware of the BHI 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 ~7A, in full operation it is ~800A. 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 BHI 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 component, 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 27 Table 13: Power consumption vs. operating mode Current Consumption (A typical) Use Case Significant Motion Step Counting Activity recognition Rotation Vector 9DOF / eCompass Standby Device BHI Accel 85 Fuser Core 43 Total 128 Accel 85 Fuser Core 46 Total 131 Accel 85 Fuser Core 65 Total 150 Accel + Gyro 950 Magnetometer 300 Fuser Core 300 Total 1550 Accel + Gyro 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 BHI supports all Virtual Sensors as defined in the Android CDD. Based on the Android specification virtual sensors 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 BHI. 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 28 Table 14: virtual sensor IDs ID ID (Non (Wakeup) Wakeup) VS_TYPE_ACCELEROMETER 1 33 VS_TYPE_GEOMAGNETIC_FIELD 2 34 VS_TYPE_ORIENTATION 3 35 VS_TYPE_GYROSCOPE 4 36 VS_TYPE_LIGHT 5 37 VS_TYPE_PRESSURE 6 38 VS_TYPE_TEMPERATURE 7 39 VS_TYPE_PROXIMITY 8 40 VS_TYPE_GRAVITY 9 41 VS_TYPE_LINEAR_ACCELERATION 10 42 VS_TYPE_ROTATION_VECTOR 11 43 VS_TYPE_RELATIVE_HUMIDITY 12 44 VS_TYPE_AMBIENT_TEMPERATURE 13 45 VS_TYPE_MAGNETIC_FIELD_UNCALIBRATED 14 46 Virtual Sensor VS_TYPE_GAME_ROTATION_VECTOR VS_TYPE_GYROSCOPE_UNCALIBRATED 15 16 47 48 VS_TYPE_SIGNIFICANT_MOTION 17 49 VS_TYPE_STEP_DETECTOR 18 50 VS_TYPE_STEP_COUNTER VS_TYPE_GEOMAGNETIC_ROTATION_VECTOR 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 In ROM Library 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 X X X X X X X X X X X X X X X X Virtual sensors as defined in Table 14 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 29 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 Quaternion+ Vector+ Vector_Uncalibrated Table 15: Virtual sensor data types Data Values 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 30 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 BHI 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 BHI 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 BHI 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, but as Lollipop 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 31 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 BHI 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 BHI sensor's driver ID and slave I2C address Vendor - vendor of the underlying HW; this can be derived from the BHI 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 BHI 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 BHI, 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 BHI, 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 32 Status Bits: unsigned 8 bits; while not required by Lollipop, for testing and debugging the BHI provides bit flags indicating: o data_available o i2c_nack o device_id_error o transient_error (e.g., magnetic transient) o 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 BHI 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 BHI will raise an interrupt request to the host processor. The driver of the host processor can then fetch data from the BHI 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 33 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 BHI 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 BHI. The BHI implements a single shared wakeup FIFO for wakeup sensors, and a single shared non-wakeup 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 BHI 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 BHI will discard the oldest data to make room for new data as it arrives. As soon as the host leaves suspend mode, the BHI will request a transfer of the entire contents of both FIFOs to the host. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 34 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 Name Description 0x00 NOP No operation 0xFF FLUSH_ALL flush all samples for both FIFOs FIFO_Flush - Enumerated Values Value BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 35 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 36 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 37 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 BHI 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 BHI, 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 BHI 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 BHI, 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 38 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 BHI'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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet PARAMETER_PAGE - Enumerated Values Value Name Page 39 Description 0 PAGE_0 The host must write this value, after finishing an access on the Algorithm Parameter Page, as an Acknowledgment for the BHI, 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 40 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 BHI, 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 Bit 7 NON_WAKEUP_FIFO_HOST_INT ERRUPT_DISABLE Bit 6 REQUEST_SENSOR_SELF_TEST Is used by the host to inform the BHI, that a selftest should be performed 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 Bit 2 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Description Affects the BHI 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 WAKEUP_FIFO_HOST_INTERRU Is a master interrupt PT_DISABLE 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. 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 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 41 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 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 BHI will soon request another transfer. It is up to the host to recover properly from this request. ALGORITHM_STANDBY_REQUEST Requests the algorithm to 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 (c) 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. BHI160(B) Data sheet Page 42 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 BHI'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_Buffer. 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 BHI. 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 Name Description 0 Read Read parameter page 1 Write Write parameter page Request - Enumerated Values Value BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 43 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 Rom_Version - Enumerated Values Value Name Description 0x2112 FUSER1_C2 FUSER1_C2, BHI160 0x2DAD FUSER1_C3 FUSER1_C3, BHI160B 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 44 10.19 Product_ID Register (0x90) - Read only This contains the product number of the device. (0x90) Bit Name Bit 7..0 Product_ID Product_ID - Enumerated Values Value Description Name Description 0x83 FUSER1_C2 FUSER1_C2, BHI160 0x83 FUSER1_C3 FUSER1_C3, BHI160B (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, BHI160 0x03 val_0x03, di03 FUSER1_C3, BHI160B BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 45 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 BHI, 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 46 10.24 Reset_Request Register (0x9B) - Read write The host writes a 1 to this register to trigger a hardware reset of the BHI's internal CPU. This bit automatically clears to 0. (0x9B) Bit Name Description Bit 7..0 Reset_Request Reset Request BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 47 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 BHI is implemented using a mail box protocol. This protocol includes a full handshake between the host and the BHI to synchronize access to the data transfer registers; these registers are used to carry control information to the BHI from the host or status information to the host from the BHI. The following sections describe the parameter pages, relevant to the user of the BHI. 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 16: 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 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 (c) 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. BHI160(B) Data sheet Page 48 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 17:Meta Event Control Enable Bit Int Enable Bit Meta Event 1 3 5 7 0 2 4 6 Meta Event 1 Meta Event 2 Meta Event 3 Meta Event 4 1 3 5 7 0 2 4 6 Meta Event 29 Meta Event 30 Meta Event 31 Meta Event 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 reduce the amount of RAM available for the FIFOs. Parameter Byte 0 1 2 3 4 5 6 7 FIFO Wakeup Non-Wakeup BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Table 18: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 (c) 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. BHI160(B) Data sheet Page 49 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 19: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 20: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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 50 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 21:Timestamp Data Parameter Byte Field Name Description Direction 0 Host IRQ Timestamp LSB Time (in units of 1/32000 seconds) that 1 Host IRQ Timestamp B2 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 1/32000 seconds) for 5 Current Timestamp B2 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 Field Name Table 22: 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 g 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 5 6 7 8 9 Gyro Sample Rate Gyro Dynamic Range Gyro Flags Unsigned 16 bit Actual dynamic range in /s Unsigned 8 bit 10 11 12 13 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 T Mag Flags Unsigned 8 bit bit 0: interrupt enable bits 5-7: Sensor Power Mode (same as Sensor Status Bits 5-7) 14 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 51 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: 0000 0110 Byte 1: 0001 0000 Byte 2: 0000 0000 Byte 3: 0000 0000 Byte 4: 0000 0000 Byte 5: 0000 0000 Byte 6: 0000 0000 Byte 7: 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 23: 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 52 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 Table 24: 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 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Value in Parameter_Write _Buffer Not used Not used Not used Not used Not used Not used Not used Bosch Sensortec (c) 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. BHI160(B) Data sheet 8 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 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 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 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Page 53 Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used Not used New Configuration New Configuration New Configuration New Configuration New Configuration Bosch Sensortec (c) 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. BHI160(B) Data sheet 70 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 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 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Page 54 New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration New Configuration Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 55 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/s2, 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 25: 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 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 (c) 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. BHI160(B) Data sheet Page 56 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 26: 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 BHI 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-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 57 For example, setting the dynamic range for the Accelerometer sensor to 156.93 m/s2 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 27: 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 Table 28: Parameter Page 15 - Soft-Pass-Through 2 Parameter Byte 0 1 2 3 4 5 6 7 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 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 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 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 58 On read bytes 1 through 3 returns the last time value written for validation purpose. On write bytes 3 is ignored. 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 status values: 0 = transfer in progress (or none ever issued yet) 1 = transfer successful 2 = I2C NACK or I2C error BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 59 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 BHI 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. Table 29: Sensor IDs, Data Types and Output Format Sensor Sensor Size Contents Scale Factor Sensor Value ID Non ID in Wakeup Wakeup FIFO 1 Padding 11 15 20 43 47 52 11 Rotation Vector 214 Game Rotation Vector Geomagnetic Rotation Vector 1 2 3 4 9 10 5 8 12 33 34 35 36 41 42 37 40 44 8 Accelerometer Magnetometer Orientation* Gyroscope Gravity Linear Acceleration Light Proximity Humidity 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 21 31 53 63 3 14 2 3 Heart Rate Activity BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Format Unsigned 8 bit value 0 means NOP 16 bit signed fixed point X, Y, Z, W Quaternion Estimated Accuracy (radians) 16 bit signed fixed point integer dynamic X, Y, Z Vector 16 bit signed integer, dynamic Status scaled to current 360 / 215 dynamic range; dynamic 8 bit unsigned integer dynamic indicating accuracy of dynamic measurement 10000Lux / 216 Absolute Scalar 16 bit unsigned 100cm / 216 integer, scaled to 1%RH maximize dynamic range None Absolute Scalar 16 bit unsigned integer 500LSB/C Scalar 16 bit signed integer, centered at scaled to maximize 24C dynamic range 1/128 Pa Absolute Scalar 24 bit unsigned integer, scaled as required None Event None dynamic dynamic Uncalib X, Y, Z; bias X, Y, Z Status None None Scalar Scalar 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 Bits 0-7 specify the activity change off, bits 8-15 specify the Bosch Sensortec (c) 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. BHI160(B) Data sheet 245 n/a 14 249 250 251 n/a 17 252 246 3 253 247 3 254 248 4 Debug None Page 60 Structure 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 BSX_C None Accel, Gyro, Mag: Accel, Gyro, Mag: BSX_B X, Y, Z, Timestamp 32 bit signed integer BSX_A (C=raw gyro, B=raw mag, A=raw accel); 32 bit timestamp of current sensor sample Timestamp LSW 1/32000 Time 16 bit unsigned seconds integer; counts at a 32KHz rate; applies to all following sensor samples; wraps every 2 seconds Timestamp MSW (Overflow) 65536/32000 Time 16 bit unsigned seconds integer; counts at Timestamp overflow rate; wraps every 36 hours Meta Events 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]) << 8)) / 16384; ... convert other fields... The Estimated Accuracy in Radians is reported as 0 for the Game Rotation Vector. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Byte Number 0 1 2 3 4 5 6 7 8 9 10 Page 61 Table 30: Quaternion+ Data Format Contents Format Sensor ID (Rotation Vector, etc.) X LSB Signed 16 bit fixed point integer X MSB Y LSB Signed 16 bit fixed point integer Y MSB Z LSB Signed 16 bit fixed point integer Z MSB W LSB Signed 16 bit fixed point integer W MSB ESTIMATED ACCURACY, RADIANS, Signed 16 bit fixed point LSB integer ESTIMATED ACCURACY, MSB 12.2 Vector+ For the many 3 axis sensors (Accelerometer, Magnetometer, Orientation, Gyroscope, Gravity, Linear Acceleration), the following layout is used. Byte Number 0 1 2 3 4 5 6 7 Table 31: Vector+ Data Format Contents Format Sensor ID (Accelerometer, etc.) X LSB Signed 16 bit integer X MSB Y LSB Signed 16 bit integer Y MSB Z LSB Signed 16 bit integer Z MSB STATUS Accuracy of measurement Table 32: Vector+ Status description Status Value Meaning 0 Unreliable 1 Accuracy Low 2 Accuracy Medium 3 Accuracy High BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 62 12.3 Vector_Uncalibrated For the two uncalibrated 3 axis sensors (Uncalibrated Magnetometer, Uncalibrated Gyroscope), the following layout is used. Byte Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Table 33: Vector_Uncalibrated Data Format Contents Format Sensor ID (Uncalibrated Magnetometer, etc.) X LSB Signed 16 bit integer X MSB Y LSB Signed 16 bit integer Y MSB Z LSB Signed 16 bit integer Z MSB X BIAS LSB Signed 16 bit integer X BIAS MSB Y BIAS LSB Signed 16 bit integer Y BIAS MSB Z BIAS LSB Signed 16 bit integer Z BIAS MSB STATUS Accuracy of measurement Table 34: Vector_Uncalibrated Status description Status Value Meaning 0 Unreliable 1 Accuracy Low 2 Accuracy Medium 3 Accuracy High 12.4 Scalar Data All of the scalar sensors (Light, Proximity, Humidity, Step Counter, Heart Rate, Temperature, Ambient Temperature, and Barometer) share a similar format. While there are differences in signed vs. unsigned and scale, the layout is similar for all (as listed in section 9.6) of them. Byte Number 0 1 2 Table 35: Scalar_Data Data Format Contents Format Sensor ID (Light, etc.) LSB Signed or Unsigned 16 bit integer (LSB only for 8bit) MSB Byte Number 0 1 2 3 Contents Barometer LSB MIB MSB BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Format Unsigned 24 bit integer Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 63 12.5 Sensor Event Data (Parameterless Sensors) Some sensors (Significant Motion, Step Detector, Tilt Detector, Padding) generate no actual data, so the FIFO will simply contain the sensor ID itself. Byte Number 0 Table 36: Sensor_Event Data Format Contents Format Sensor ID (Significant Motion, etc.) 12.6 Activity Recognition Data (Sensor_Activity_Rec_Data) The activity sensor outputs 16 bits of data whenever there is a change detected in activity. Bits are provided to indicate both the onset of an activity and the end of it. Table 37: Activity Recognition Data Format Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Contents Still activity ended Walking activity ended Running activity ended On Bicycle activity ended In Vehicle activity ended Tilting activity ended Reserved Reserved Still activity started Walking activity started Running activity started On Bicycle activity started In Vehicle activity started Tilting activity started Reserved Reserved 12.7 Debug Customers using the SDK can use printf() to send ASCII strings to the host in the non-wakeup FIFO, or fwrite() to send custom binary data. The data will be sent with Sensor ID = Debug. The lower 6 bits include the number of valid bytes in the packet with the range from 0 up to 12. For example, if a 20 character long string is printed out: "ABCDEFGHIJKLMNOPQRST", the FIFO will contain: Debug (=245), 0x0C, "ABCDEFGHIJKL" Debug, 0x08, "MNOPQRST" Table 38: Debug Byte 0 1 2-13 Bit 0-7 0-5 6 7 0-7 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Contents Sensor ID (Debug) Amount of payload bytes (0-12) Payload data format (0: ASCII, 1:Binary) Reserved Debug Payload (Bytes) Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 64 12.8 Sensor Data scaling The table of sensor types and their data formats above indicates a fixed scale factor for each sensor's data for many sensors. The selection of this scale factor is meant to ensure the full dynamic range of a sensor can fit within the number of bits provided. The exceptions are the accelerometer-, gyroscope-, and magnetometer-derived sensors. Those sensors' scale factors are set dynamically based on the largest dynamic range setting for any related virtual sensors (see section 11.4). Default Scale Factors The default scale factor specified for the intrinsic Accel, Gravity, and Linear Acceleration allows for a 4g range (39.24 m/s2). The default scale factor for the intrinsic Gyro allows for a 2000 / s range (34.9 radians / s). The default scale factor for the magnetometer is based on a dynamic range of 1000T, despite the fact that many sensors can read larger values than this. The AK8963, for example, can measure fields up to 4912T. In return, there will be 2 more bits of resolution for normal readings, keeping in mind that the Earth's magnetic field ranges from 25T to 65T. Lollipop does not require any particular range for the magnetometer beyond this. These sensors all use a scale factor that adjusts automatically to fit the actual dynamic range of each sensor, if changed from the defaults. The host needs to query the actual dynamic range and then perform a calculation to determine the scale factor as dynamic range / 2^(number of bits), where the number of bits is 15 for signed 16 bit integers and so on. NOTE: The accelerometer and gyroscope dynamic range settings, as discussed in section 11.4, need to be converted to m/s2 and rad/s, before being used to scale the output data as described below. For example, the Accelerometer produces 16 bit signed data for the X, Y, and Z axes. The scale factor for a dynamic range of 156.93 m/s2 would be: Accel Scale Factor = Dynamic Range / Maximum Positive Value = 156.93 / 32767 = 4.789e -3 m/s2. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 65 12.9 Meta Events These indicate asynchronous, low periodicity events. These can be individually enabled or disabled in the Meta Event Control Parameter in the System Parameter Page. They can also be configured to enable or disable a host interrupt when they occur; this would occur even if there were no pending samples. The Initialized Meta Event will be the first event in the FIFO (following the current timestamp) after initialization. Once the host receives this, it is safe to interact with the parameter I/O system to configure the chip. See section 9.9 for more details. Meta Event Type Name 0 1 Not used Flush Complete 2 Sample Rate Changed Power Mode Changed Error 3 4 Byte 1 Non Wake FIFO Default Int Enable State Enabled Disabled Enabled Disabled Not used Enabled Disabled Enabled Disabled Sensor Type Power Mode Disabled Disabled Disabled Disabled Error Register Debug State Enabled Enabled Enabled Enabled Sensor Status Bits Loss Count MSB Not used Enabled Enabled Enabled Enabled Enabled Disabled Disabled Disabled Enabled Disabled Enabled Disabled Bytes Remai ning MSB Test Result RAM Ver MSB Disabled Disabled Disabled Disabled Enabled Disabled Enabled Enabled Enabled Enabled Enabled Enabled Sensor Type 12 FIFO Overflow Loss Count LSB 13 Dynamic Range Changed FIFO Watermark Sensor Type Self-Test Results Initialized Sensor Type 16 Non Wake FIFO Default Enable State Not used Reserved Sensor Error 15 Wake FIFO Default Int Enable State Sensor Type from FIFO_FLUSH register Sensor Type 5-10 11 14 Table 39: Meta Events Byte 2 Wake FIFO Default Enable State Bytes Remaining LSB RAM Ver LSB Flush Complete This meta event is the only official Android meta event. It will be inserted in the FIFO after a Flush FIFO request, whether there is any data in the FIFO or not. Flushing in Android means "transfer to host", not "discard." BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 66 Sample Rate Changed This meta event occurs when a given sensor's sample rate has been set for the first time, and/or when a requested change to the rate actually occurs. Byte 1 indicates the sensor type whose rate changed. Power Mode Changed This meta event indicates when a given sensor powers up or down; the sensor type is passed in byte 1. Error The error meta event will only occur when unexpected internal firmware errors occur. It is important for the host to log such events, including byte 1 (error register) and byte 2 (debug state), to help with troubleshooting. The only proper recovery from this is to reset the BHI, reload the RAM patch, and reinitialize the sensors to the desired rates, latencies, and so on. Sensor Error This meta event occurs when there is either a sensor mismatch between the RAM patch loaded and the hardware available, or, when a sensor fails to respond when expected. Byte 1 specifies the sensor type, and byte 2 specifies the sensor status bits for that sensor. This will indicate whether the error was due to an I2C NACK or Device ID mismatch. The Device ID mismatch error should never occur in a properly configured system in production. The I2C NACK error indicates a hardware failure. FIFO Overflow This meta event indicates when data loss has occurred due to the host being unable to read out FIFO data quickly enough. This may be intentional, such as when the AP is suspended, or it may be due to having too many sensors on at high sample rates with a slow host I2C rate or slow driver implementation. It reports in bytes 1 and 2 a saturating count of lost bytes. Following this meta event, the BHI will insert an accurate Timestamp MSW and Timestamp LSW event, to ensure the host will be able to report accurate timestamps after the area of data loss. The BHI, when it detects a FIFO overflow, automatically discards approximately 200 bytes of FIFO data in order to make room for more data, make room for the FIFO Overflow and Timestamp events, and ensure that at least some new data will appear in the FIFO between FIFO Overflow events, rather than become saturated with such events in worst case conditions. Dynamic Range Changed This event will be placed in the FIFO as soon as a requested change in dynamic range has occurred. The host may wish to wait for this event before changing the scale factor, in the event that a sensor whose dynamic range was changed was already on. Otherwise, the host could apply the wrong scale factor on some samples, and report invalid data as a result. FIFO Watermark This event occurs within a few dozen bytes of the specified watermark level. 12.9.1 Self-Test Results Byte 1 indicates which sensor is reporting self-test results. The Sensor Type field values for each physical sensor type that can perform self-test are: Accelerometer = ID 1 Uncalibrated Gyroscope = ID 16 Uncalibrated Magnetometer = ID 14 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 67 Byte 2 indicates the test status: 0: Test Passed 1: X Axis Failed 2: Y Axis Failed 3: X & Y Axes Failed 4: Z Axis Failed 5: X & Z Axes Failed 6: Y & Z Axes Failed 7: All Axes Failed or Single Test Failed (if testing of each axis cannot be done) 12.9.2 Initialized This is the first meta event reported after reset. The RAM version is reported in bytes 1 and 2, for convenience. Timestamp LSW The BHI outputs the Timestamp LSW event before every sensor sample whose timestamp is different from the previous Timestamp LSW placed in the FIFO. This even contains the least significant 16 bits of a sensor sample's 32 bit timestamp. If a sensor sample is about to be inserted in the FIFO which shares the same timestamp, this event is not inserted, in order to conserve FIFO space. Timestamp MSW This event will be output when the most significant 16 bits of a sensor sample timestamp differs from the previous Timestamp MSW event placed in the FIFO. It, and the Timestamp LSW event, will be placed in the FIFO after a FIFO overflow as well. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 68 13. Reading FIFO Data As mentioned previously, registers 0x00 to 0x31 form the data transfer area. Unlike the other registers, these have strict protocols for host access. When the host receives the host interrupt from the BHI, it should first read the Bytes Remaining registers to determine the number of bytes currently in the FIFO. It should then read all those bytes in one or more consecutive I2C read operations. This area is double buffered. FIFO data is placed in the two buffers by the FUSER core, as needed, to transfer the number of bytes in the Bytes Remaining registers. The host only needs to start reading at register 0, and continue reading until the entire transfer is complete. The register address being read auto-resets when reading past 0x31, which also causes the double buffers to swap; when this happens, the FUSER core fills the just emptied buffer with the next set of FIFO data. In this manner, the host will be able to set up a single I2C transfer for the entire Bytes Remaining value. The transfer should be started as: <0x00 (register address 0x00)> Due to the fact that the double buffers are 50 bytes in size, it is recommended that if the host needs to break up a long FIFO read into multiple smaller individual I2C reads, it do so in multiples of 50 bytes, and start reading each one starting at register address 0. The current hardware implementation cannot tell the FUSER core if the host has read less than 50 bytes in any given buffer. As a result, it is up to the host to: read in multiples of 50 bytes; read the entire buffer in one transfer; or follow the Pause and Resume Mechanism below to begin each transfer at the proper I2C address. NOTE: reading more data than the Bytes Remaining registers indicate can lead to data corruption; always read the amount specified and no more. 13.1 Host Interrupt Behavior The host interrupt asserts high on reset or power up, and is cleared by loading a RAM patch or reading the Host Status register (0x35). During normal operation, it will also assert high when data is available in the FIFO and it is time to notify the host. A host interrupt is generated when: 1. An enabled sensor has a zero max report latency (timeout) and has generated a sample 2. A sensor has a non-zero max report latency, it has a sample in the FIFO, and it has timed out before any other sensor with a shorter latency or zero latency generates a sample 3. Same as 2, but the FIFO Watermark is non-zero, and it has been exceeded before the latencies timed out 4. A meta event has occurred which has its interrupt enable set (by default, only internal firmware errors or sensor hardware errors can generate interrupts) BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 69 5. The AP is in suspend mode, one or more wakeup sensors are enabled, and one or more wakeup events have occurred (no other event except unexpected reset will generate an interrupt in this state), and the wakeup FIFO interrupt disable bit is clear in the Host Interface Control register 6. The AP is in suspend mode, the wakeup FIFO watermark is non-zero, and all enabled sensors have non-zero latency; when the watermark is reached, the AP will be woken up The host interrupt will remain asserted until the host has emptied the FIFO or has aborted the transfer with the Abort Transfer bit in the Host Interface Control register (0x55). It may then reassert immediately depending on the notification criteria above. The host interrupt will always go low for a minimum of a few s between the time the host receives it and empties the FIFO and any subsequent transfer. This is to ensure that either level or edge-triggered interrupts can be used in the AP. The time at which the rising edge of the interrupt occurred will be accessible as the Host IRQ Timestamp parameter of the System Parameter Page. This timestamp is a 32 bit counter, incremented at 32 KHz, and synchronized with the real time counter used to timestamp sensor data. 13.2 Pause and Resume Mechanism The transfer can be paused by ending the I2C transfer with a condition, and resumed later by issuing: The restart_register_address must be calculated by the host as: restart_register_address = bytes_transferred_so_far MOD 50 The Update Transfer Count bit in the Host Interface Control register can be used to get an updated value in registers 0x38/0x39 (Bytes Remaining). The BHI cannot detect the pause in transfer so it cannot automatically update the transfer count itself. However, this updated count will not affect the length of the current transfer; it simply advises the host of how much will eventually be transferred between the current and next host interrupt. Again, reading more data from the FIFO than the original Bytes Remaining value is not recommended. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 70 13.3 FIFO Overflow Handling In the event that the FIFO overflows, due too excessively high sample rates and/or slow reading by the host (or even the host being asleep), we will discard the oldest data first. Once the host begins reading again, we will insert an Overflow Meta Event (if enabled) into the buffer at the point of data loss, followed immediately by the Timestamp MSW and Timestamp LSW values for the continuation point, followed finally by the oldest remaining data. In this way, the host can know that data was lost and know an accurate timestamp for the data that continues after the gap - after the lost data. Last sample before data loss Overflow Meta Event Timestamp MSW Timestamp LSW Oldest remaining sample ... Time See the FIFO examples in section 13.9 for more details. 13.4 Host Suspend Procedure When the application processor goes into suspend mode, it should tell the BHI by first writing a 1 to the AP Suspend bit in the Host Interface Control register, so that only wake-up sensors issue a host interrupt. It is recommended that the host precede this with a FIFO Flush and complete emptying of the FIFO, so that the host is not immediately woken by mistake. 13.5 Host Wakeup Procedure When the AP wakes, it should notify the BHI by clearing the AP Suspend bit in the Host Interface Control register, so that all enabled sensors can (if so configured) issue a host interrupt as needed. The BHI will detect this action and automatically update the Bytes Remaining registers if there is a pending host interrupt. If the AP did not notify the BHI of entering and leaving suspend mode, but instead masked the host interrupt line, the AP may find the host-interrupt line already asserted when it comes out of suspend. The Bytes Remaining registers will contain an old value, which, while valid, will likely be smaller than the current number of bytes in the FIFO. Once the host has transferred this smaller amount of bytes, the next host transfer will cover the remaining amount to be transferred. 13.6 Non-Compliant Hosts Hosts must read the Bytes Remaining registers prior to starting the FIFO emptying protocol in order to read buffered data. Hosts must read at least that number of bytes of data; if it reads more, pad bytes (0s) will be returned. Hosts which read less than this will not receive a new host interrupt until they finish reading the remainder of the buffer, or until they request a transfer abort (which will cause loss of data). Hosts could read in fixed size blocks until, after parsing each block, it detects one or more pad bytes in the stream. NOTE: Any data read after the first pad byte should be discarded, as it may be a repetition of previous data. The host should stop reading as soon as this first pad byte is detected. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 71 13.7 Recovery from Loss of Sync If the host cannot make sense of the data it is reading from the FIFO, it may have lost sync. While this should never occur, if it does, the host should abort the transfer by writing a 1 to the Abort Transfer bit in the Host Interface Control register. The next transfer will start with a whole (not partial) block of data. Alternatively, the host could simply finish the current transfer, discard what it is receiving, and then wait for the next transfer as signaled by a host interrupt. By definition, the start of a FIFO read will always begin at the start of a valid sensor event. 13.8 Padding Data FIFO reads beyond the value previous read from the Bytes Remaining registers will result in the host reading 0s, which indicate end of data. A 0 sensor ID is defined to be a single byte NOP sensor event. NOTE: Due to hardware limitations, if the amount of FIFO data to transfer modulus 50 is greater than 0 and less than 3, the BHI will add enough padding bytes to bring up the size of the final transfer to 4 bytes minimum. 13.9 Aborting a Transfer The abort transfer action can be used to recover from loss of sync or for fast emergency shutdown. As mentioned previously, there will likely be approximately 100 bytes of FIFO data that are discarded when the transfer is aborted, including any partial sensor sample or event that started in the 100 byte transfer registers and was scheduled to be finished in the next buffer. If the host wishes to respond to the next host interrupt and parse out the remaining FIFO data, it will see a valid sample at the start, but, the BHI makes no attempt to provide an accurate starting timestamp in this case. So, the host needs to read, parse, and discard events up until the first Timestamp LSW event and/or Timestamp MSW event. If there was one or more continuous output sensors enabled, then the host need only discard up to the first Timestamp LSW event; if the timestamp value is greater than the previous value seen before the abort, the host's knowledge of the timestamps of sensor samples that follow is accurate. However, if the first Timestamp LSW value seen after the abort is less than the previous value, the MSW has incremented, and the Timestamp MSW value was lost in the 100+ bytes that were discarded. If there were only on-change, special, or one-shot sensors enabled, the host cannot be guaranteed to know the correct 32 bit timestamps for any events it sees after the abort until the next Timestamp MSW is read and parsed. It may still want to report the events it does see, as they may be important to the user, but the host will need to estimate the timestamps. 13.10 FIFO Parsing Examples 13.10.1 Accelerometer & Step Counter This example assumes the FIFO watermark is disabled, the Accelerometer is configured for 50Hz and 40 millisecond latency; the only other sensor on is the Step Counter, which is set for 0 latency. This is not the first sample; the last known Timestamp MSW = 0x0010 (~32 seconds after startup). At 50Hz, the timestamp will increment approximately 640 ticks between samples (640/32000 = 20ms = 1/50Hz). BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 72 Steps are listed in time order from the host's perspective. 1. Host interrupt received from BHI 2. Host reads registers 0x38-0x39; value read is 25 3. Host reads registers 0x00-0x18; data received: Byte Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Value 252 0xF8 0xFF 1 0xFE 0xFF 0x05 0x00 0x69 0x08 0x02 253 0x11 0x00 252 0x78 0x02 1 0xFD 0xFF 0x08 0x00 0xFC 0x07 0x02 Meaning Timestamp LSW Event LSB MSB; Time = 0x0010FFF8 / 32000 = 34.81575 seconds Accelerometer Event X LSB X MSB; X value = 0xFFFE = -2 = -0.009578 m/s2 Y LSB Z MSB; Y value = 0x0005 = 5 = 0.023945 m/ s2 Z LSB Z MSB; Z value = 0x0869 = 2153 = 10.310717 m/s2 Status = medium accuracy Timestamp MSW Event LSB MSB Timestamp LSW Event LSB MSB; Time = 0x00110278 / 32000 = 34.83575 seconds Accelerometer Event X value = -3 = -0.014367 m/s2 Y value = 8 = 0.038312 m/s2 Z value = 0x07FC = 2044 = 9.798 m/s2 Status = medium accuracy 4. The host decodes this, and as indicated in the meaning column, learns that: a. The FIFO contained the least significant word (LSW) of the timestamp; using that and the previous timestamp MSW gives us an actual timestamp for the next sample as 34.81575 seconds b. There are two samples of the Accelerometer, which makes sense because the sample latency divided by the sample period is 2 c. The samples are separated by a full timestamp (both the MSW and the LSW) because the LSW overflowed between samples d. Using the default scale factor of 4.789e -3 m/s2, it can calculate the actual values of the Accelerometer X, Y, and Z axes 5. The host now waits for the next interrupt 6. The human was stepping during this; right after the next accelerometer sample, the Step Counter outputs a new step count (NOTE: the accelerometer data is just dummy data; real data taken when a person is walking will of course change constantly on all axes more than this data does) 7. Host interrupt received from BHI 8. Host reads registers 0x38-0x39; value read is 14 9. Host reads registers 0x00-0x0D; data received: BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Byte Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Value 252 0xF8 0x04 1 0xFF 0xFF 0x11 0x00 0x82 0x07 0x02 19 0x01 0x00 Page 73 Meaning Timestamp LSW Event LSB MSB; Time = 0x001104F8 / 32000 = 34.85575 seconds Accelerometer Event X LSB X MSB; X value = 0xFFFE = -1 = -0.004789 m/s2 Y LSB Z MSB; Y value = 0x0011 = 17 = 0.081413 m/ s2 Z LSB Z MSB; Z value = 0x0782 = 1922 = 9.204458 m/s2 Status = medium accuracy Step Counter Event LSB MSB = 1st step 10. The host decodes this, and learns that: a. There is a new timestamp, and the sample time is now 34.85575 seconds b. There is one accelerometer sample c. There is a step counter sample d. The step counter, since it had a latency of zero, flushed the FIFO earlier than it would have been by the accelerometer's latency of 40ms 11. Approximately 40 milliseconds later (the latency for the accelerometer), another host interrupt followed by reading of two accelerometer samples will occur (not shown) BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 74 14. Package 14.1 Outline Dimensions The sensor package is a standard LGA package; dimensions are shown in the following diagram. Units are in mm. NOTE: Unless otherwise specified tolerance = decimal 0.1mm. Figure 8: Package outline in LGA24, 3x3x0.95mm3 14.2 Sensing Axes Orientation and Axis Remapping The default device axis orientation is shown in Figure 9: below. This orientation is valid for all sensor outputs (physical and virtual). "Accel" and "Gyro" is already integrated in the BHI according to this axis orientation. If there are other sensors connected to the hub, e.g. "Magnet" the physical alignment of the corresponding sensors and its axis should be according to Error! Reference source not found.Figure 9 as well to guarantee correct 9DoF data fusion. Figure 9: Device sensing axis orientation Z; z; z X; x; x Y; y; y Accel; Gyro; Magnet BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 75 In case the default axis orientation of the BHI and/or its sensor extensions does not match to the target device coordinate system an axis remapping can be performed to reassign the sensing axes of the BHI so, that they match to the axes defined by the target device coordinate system. Possible placement and remapping options are given in Figure 10. Figure 10: Placement options with respect to device orientation Example P1 If the sensing axis of the sensor do not match to the coordinate system of the target device or to sensor extensions which are potentially connected to the hub, several tools can be used to remap the sensing assignment in the firmware file. This enables a subsequent axis alignment of all virtual and physically integrated and/or attached sensors to match the target coordinate system. For details regarding the orientation matrix refer to Table 23: Physical Sensor Information; page 51. For details and technical support regarding the remapping of this matrix please refer to the Bosch Sensortec document BST-BHY1-AN001-00 "Axes remapping" placed within the section "Application notes", available on https://www.bosch-sensortec.com/bst/support_tools/downloads/overview_downloads or contact our regional offices, distributors and sales representatives. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 76 14.3 Landing pattern recommendation Figure 11: Landing pattern 0.35 24 23 22 21 20 19 18 2 17 3 16 4 15 5 14 0.4 3.0 0.20 1 7 8 9 10 11 1.16 0.20 6 13 12 1.16 3.0 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 77 14.4 Marking 14.4.1 Mass production Table 40: Marking of mass production material Labeling Name Counter ID CCC HP Symbol CCC Remark 3 alphanumeric digits, variable to generate trace-code First letter of second row H Second letter of second row P Product identifier H = "Q" denoting BHI160; 0 273 141 230 H = "N" denoting BHI160B; 0 273 141 309 Internal use Pin 1 identifier * -- 14.4.1 Engineering samples Table 41: Marking of engineering samples Labeling Name Counter ID CCC HPE Symbol CCC Remark 3 alphanumeric digits, variable to generate trace-code First letter of second row H Second letter of second row P Product identifier H = "Q" denoting BHI160; 0 273 141 230 H = "N" denoting BHI160B; 0 273 141 309 Internal use Third letter of second row E "E" denotes Engineering Samples Pin 1 identifier * -- BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 78 14.5 Soldering guidelines The moisture sensitivity level of the BHI sensors corresponds to JEDEC Level 1, see also IPC/JEDEC J-STD-020D "Joint Industry Standard: Moisture/Reflow Sensitivity Classification for non-hermetic Solid State Surface Mount Devices" IPC/JEDEC J-STD-033A "Joint Industry Standard: Handling, Packing, Shipping and Use of Moisture/Reflow Sensitive Surface Mount Devices" The sensor fulfils the lead-free soldering requirements of the above-mentioned IPC/JEDEC standard, i.e. reflow soldering with a peak temperature up to 260C. Figure 12: Soldering profile 260 C BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 79 14.6 Handling instructions Micromechanical sensors are designed to sense acceleration with high accuracy even at low amplitudes and contain highly sensitive structures inside the sensor element. The MEMS sensor can tolerate mechanical shocks up to several thousand g's. However, these limits might be exceeded in conditions with extreme shock loads such as e.g. hammer blow on or next to the sensor, dropping of the sensor onto hard surfaces etc. We recommend avoiding g-forces beyond the specified limits during transport, handling and mounting of the sensors in a defined and qualified installation process. This device has built-in protections against high electrostatic discharges or electric fields (e.g. 2kV HBM); however, anti-static precautions should be taken as for any other CMOS component. Unless otherwise specified, proper operation can only occur when all terminal voltages are kept within the supply voltage range. Unused inputs must always be tied to a defined logic voltage level. For more details on recommended handling, soldering and mounting please refer to the corresponding "Handling, soldering and mounting instructions" document or contact our regional offices, distributors and sales representatives. 14.7 Tape and reel specification The BHI is shipped in standard cardboard box. The box dimension for one reel is: L x W x H = 34.5 cm x 34.5 cm x 4.5 cm. BHI quantity: 5,000 pcs per reel, please handle with care. The following picture describes the dimensions of the tape used for shipping the BHI sensor device. The material of the tape is made of conductive polysterene (IV). Figure 13: Tape and reel dimensions in mm BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 80 14.7.1 Orientation within the reel Figure 14: Orientation of the devices relative to the tape 14.8 Environmental Safety The BHI sensor meets the requirements of the EC restriction of hazardous substances (RoHS) directive, see also: Directive 2011/65/EU und (EU) 2015/863 of the European Parliament and of the Council on the restriction of the use of certain hazardous substances in electrical and electronic equipment. 14.9 Halogen content The BHI is halogen-free. For more details on the analysis results please contact our regional offices, distributors and sales representatives. 14.10 Multiple sourcing Within the scope of Bosch Sensortec's ambition to improve its products and secure the mass product supply, Bosch Sensortec employs multiple sources in the supply chain. While Bosch Sensortec takes care that all of technical parameters are described above are 100% identical for all sources, there can be differences in device marking and bar code labeling. However, as secured by the extensive product qualification process of Bosch Sensortec, this has no impact to the usage or to the quality of the product. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 81 15. Legal disclaimer 15.1 Engineering samples Engineering Samples are marked with an asterisk (*) or (e) or (E). Samples may vary from the valid technical specifications of the product series contained in this data sheet. They are therefore not intended or fit for resale to third parties or for use in end products. Their sole purpose is internal client testing. The testing of an engineering sample may in no way replace the testing of a product series. Bosch Sensortec assumes no liability for the use of engineering samples. The Purchaser shall indemnify Bosch Sensortec from all claims arising from the use of engineering samples. 15.2 Product use Bosch Sensortec products are developed for the consumer goods industry. They may only be used within the parameters of this product data sheet. They are not fit for use in life-sustaining or security sensitive systems. Security sensitive systems are those for which a malfunction is expected to lead to bodily harm or significant property damage. In addition, they are not fit for use in products which interact with motor vehicle systems. The resale and/or use of products are at the purchaser's own risk and his own responsibility. The examination of fitness for the intended use is the sole responsibility of the Purchaser. The purchaser shall indemnify Bosch Sensortec from all third party claims arising from any product use not covered by the parameters of this product data sheet or not approved by Bosch Sensortec and reimburse Bosch Sensortec for all costs in connection with such claims. The purchaser must monitor the market for the purchased products, particularly with regard to product safety, and inform Bosch Sensortec without delay of all security relevant incidents. 15.3 Application examples and hints With respect to any examples or hints given herein, any typical values stated herein and/or any information regarding the application of the device, Bosch Sensortec hereby disclaims any and all warranties and liabilities of any kind, including without limitation warranties of non-infringement of intellectual property rights or copyrights of any third party. The information given in this document shall in no event be regarded as a guarantee of conditions or characteristics. They are provided for illustrative purposes only and no evaluation regarding infringement of intellectual property rights or copyrights or regarding functionality, performance or error has been made. BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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. BHI160(B) Data sheet Page 82 16. Document history and modifications Rev. No 0.1 0.2 0.3 1.0 1.1 1.2 1.3 1.4 Chapter All All 1.1 1.2 1.3 2.1 9.2 9.3 9.4 10.4 11.19 14.2 15 All All All 10.17 10.19 10.20 14.4 Description of modification/changes 1st preliminary version Major update I/O Voltage Levels Duplicate table entries removed Max Rating ESD-MM, HBM adjusted Updated typical values for external components Updated BSX ODR description Updated Step Counter power consumption Updated Gesture description Added ROM Content Information on virtual sensors Host Status description updated Changed Product ID description Added Axis Remapping information Updated Package dimensions Added Tape & Reel Spec Spell correction Final release Date Oct. 2014 Mar. 2015 Jan. 2016 Jul. 2016 Introduced new tech. ref. code BHI160B 0.273.141.309 All 9.11 10.4 Added Android 6 / M / Marshmallow (non HiFi) 11.1 14.2 Updated explanation of byte 11-15 "orientation matrix" Introduced BST-BHY1-AN001-00 "Axes remapping". 10.12 Corrected Type in register description 0x55, Bit 7 11.5 14.8 11.1 1.1 Added description for soft-pass-through mode Updated reference to ROHS directive Fixed typos Changed typical voltage to 1.8V Dec. 2016 Mar 2017 April 2019 May 2019 Bosch Sensortec GmbH Gerhard-Kindler-Strasse 9 72770 Reutlingen / Germany contact@bosch-sensortec.com www.bosch-sensortec.com Modifications reserved | Printed in Germany Specifications subject to change without notice Document number: BST-BHI160B-DS000-02 Revision_1.4_052019 BST-BHI160B-DS000-03 | Revision 1.4 | May 2019 Bosch Sensortec (c) 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.