How to use the BlueNRG-Tile Bluetooth LE enabled sensor node development kit
Introduction
The STEV
board based on BlueNRG-2 SoC Bluetooth Low Energy application processor. This sensor board has accelerometer,
gyroscope, magnetometer, pressure, humidity, Time-of-Flight and microphone sensors, and is powered by a common CR2032
coin battery.
The sensor board communicates with a Bluetooth LE enabled smartphone running the ST BLE Sensor app, available on Google
Play and iTunes stores.
The STEVAL-BCN002V1D adapter board is used to program and debug the sensor board. The adapter board is powered via
USB.
1. STEVAL-BCN002V1 “BlueTile” sensor node with inertial and environmental digital MEMS sensors, a digital MEMS microphone, a time-offlight proximity sensor and a Bluetooth 5.0 wireless system-on-chip with a Cortex-M0 core
2. STEVAL-BCN002V1D host board to Flash and debug the sensor node
AL-BCN002V1B Bluetooth LE enabled sensor node development kit features the STEVAL-BCN002V1 multi-sensor
Figure 1. STEVAL-BCN002V1B BlueTile kit
UM2501 - Rev 3 - June 2020
For further information contact your local STMicroelectronics sales of
fice.
www.st.com
1Safety Information
Any type of usage not specified by the manufacturer may compromise the protection mechanisms in the device.
1.1Class 1 laser product
VL53L1X contains a laser emitter; the device is designed to limit the laser output within Class 1 laser safety limits
under all conditions including single faults, in compliance with IEC 60825-1:2014 (third edition).
Recommended settings and operating conditions specified in VL53L1X datasheet and user manual MUST be
respected.
The laser output MUST NOT be increased by any means and no optics should be to used focus the laser beam.
Use of controls or adjustments or performance of procedures other than those specified in VL53L1X datasheet
and user manual may result in hazardous radiation exposure.
UM2501
Safety Information
UM2501 - Rev 3
page 2/44
2STEVAL-BCN002V1 BlueTile sensor node
I2C
LPS22HH
RGB LED
user button
UART
MP34DT05-A
LIS2MDL
32 MHz
I2C
I2C
VL53L1
400
kHz
1.6
I2C
Test points
TEST
VDDGND
MHz
RFTEST
PDM
inductor
10 pin
connector
32 KHz
Integrated
antenna
LSM6DSO
UART_RX line
I2C
BALF-NRG-02D3
HTS221
I2C
TEST ADC
ADC
RFTEST
SWD
SDASCL
IRQ
IRQ
I2C
3 VO LTS
+
BlueNRG-2
d
Pi-network
BlueTile is a small form-factor reference design ready for you to extend and customize, as well as a development
platform for BLE-enabled applications using the BlueNRG-2
and evaluate the performance of the sensors and the capabilities of the BLE.
Thanks to its small and thin design, BlueTile can be used in the field for data collection activities to test and
develop new algorithms.
Figure 2. STEVAL-BCN002V1 BlueTile block diagram
BlueNRG-2: Bluetooth 5.0 network and application processor
LSM6DSO: accelerometer and gyroscope
LIS2MDL: magnetometer
LPS22HH: barometer
HTS221: relative humidity and temperature sensor
VL53L1X: time-of-flight proximity sensor
MP34DT05-A: microphone
BALF-NRG-02D3: integrated balun
SDK. It is also an evaluation tool to help you assess
UM2501
STEVAL-BCN002V1 BlueTile sensor node
UM2501 - Rev 3
•The integrated SMD antenna needs clearance area and passives for proper tuning (FT1, FT2 and MT).
•
The Pi-network is only intended for flexibility and for testing. It is not populated as the integrated balun
provides the necessary matching.
•The 32kHz crystal allows lower power consumption BLE Sleep Mode.
•The inductor allows lower power consumption in BLE Active Mode.
•The STEVAL-BCN002V1 BlueTile sensor node is supplied with the default firmware (BLE_SensorDemo,
available in the SDK) already loaded. The firmware enables the streaming of sensor data to the reference
smartphone app (ST BlueMS, available on Android™ and iOS™ stores).
page 3/44
1a
2a
4a
5a
6a
2b
2c
2d
2e
2f
3b
4b
4c
4d
4e
4f
4g
4h
1b
5b
6b
7a
7b
8
RESETN
UART RX
UART TX
SWD CLK
SWD IO
IOIOIOIO
GND
BOOT
GND GND VDD
1
2
10
UM2501
System architecture
Figure 3. STEV
1a. BlueNRG-2 Bluetooth 5.0 network and application processor 1b. BALF-NRG-02D3 integrated balun and matching network
2a. LPS22HH ambient pressure sensor 2b. LSM6DSO smart accelerometer and gyroscope 2c. LIS2MDL magnetometer 2d.
VL53L1X proximity by time-of-flight 2e. HTS221 relative humidity and temperature 2f. MP34DT05-A top-port digital microphone
3a. User button 3b. RGB LED
4a. I2C SCL 4b. I2C SDA 4c. GND 4d. ADC 4e. TEST 4f. VDD 4g. GND 4h. RFTEST
5a. II-network (not mounted) 5b. SMD antenna
6a. Inductor to enable lowest power BLE active mode 6b. 32kHz crystal to enable lowest power BLE sleep mode
7a. Battery holder 7b. CR2032 battery (not included)
8. 10-pin connector
FCC ID: S9NSTEBCN2V1 IC ID: 8976C-STEBCN2V1
AL-BCN002V1 sensor node front and rear components
The BlueTile sensor node is supplied with the firmware already loaded. The default firmware includes two
libraries:
1.
MotionFX fusion library for orientation estimation (visualized with a rotating cube).
2.BlueVoice library to stream the voice captured by the MEMS microphone over the BLE connection
(reproduced by the smartphone speaker, if not in vibration mode).
The STBLESensor app can be used to plot and log sensor data in real time on your smartphone.
RELATED LINKS
STBLE sensor documentation
2.1System architecture
The BlueTile is powered by a coin-cell battery (CR2032). The voltage is not regulated because the sensors and
the BlueNRG-2
embedded linear power regulator and switching mode power converter (DC-DC).
2.1.1Power section for BlueNRG-2
The BlueNRG-2 in active mode can use the embedded linear voltage regulator (LDO) or the embedded DC-DC
converter (DC-DC).
•
LDO regulator [Active mode, CPU Flash and RAM on]:
–RX 14.5 mA at 3 V, TX 17.2 mA when output power is +2 dBm
–range is 12-28.8 mA when output is -14 to +8 dBm
•DC-DC converter [Active mode, CPU Flash and RAM on]:
–RX 7.7 mA at 3 V, TX 9 mA at 3 V when output power is +2 dBm
–range is 6.6-15.1 mA when output is -14 to +8 dBm
UM2501 - Rev 3
can all operate at the voltage range of the battery. In any case, the BlueNRG-2 has its own
page 4/44
System architecture
Note:The BlueTile sensor node includes the inductor needed by the DC-DC converter to allow lower power
consumption in active mode.
In Sleep Mode, the BlueNRG-2 device can use its internal 32 kHz ring oscillator (RO) or the external 32 kHz
crystal oscillator (XO) available on the BlueT
mode:
•Sleep Mode [32 kHz ring oscillator, 24 kB RAM retention]: 2.1 µA at 3 V
•Sleep Mode [32 kHz crystal oscillator, 24 kB RAM retention]: 0.9 µA at 3 V
ile sensor node, which offers lower power consumption in sleep
2.1.2Radio frequency section
The radio frequency section of the BlueTile includes the following elements:
1.
A BALF-NRG-02D3 ultra-miniature balun which integrates matching network and harmonics filter.
2.A Pi-network which allows additional filtering and provides access points for testing.
Note:This network is not populated, as the integrated balun provides the necessary matching.
3.An SMD 2.4 GHz antenna, which requires a certain clearance area on the PCB and specific passives for
precise tuning (FT1, FT2 and MT).
2.1.3MEMS sensor section
The MEMS sensor section of the BlueTile sensor node includes inertial and environmental MEMS sensors
connected with the BlueNRG-2 via an I2C bus operating at 400 kHz.
The MEMS microphone is connected with BlueNRG-2 through a dedicated line to transfer the PDM (Pulse
Density Modulated) stream at 1.6 MHz, which is converted to PCM (Pulse Coded Modulation) by the integrated
digital filter in the ADC block on the BlueNRG-2.
All sensors can generate interrupts, but only the interrupts from the LIS2MDL magnetometer and the LSM6DSO
accelerometer and gyroscope are connected with the BlueNRG-2 through dedicated and independent lines.
•
The LIS2MDL magnetometer interrupt line is push-pull only and must have its own independent line. The
interrupt pin of this sensor is connected with BlueNRG-2 to enable applications such as “reed-switch”, which
is activated by an external magnet.
•The LSM6DSO smart accelerometer and gyroscope interrupt pin is an input at boot. It has an internal pulldown. If the pin is low at boot, the I2C interface is selected, otherwise the I3C interface is selected. The pin
can be reconfigured as open-drain, but the external pull-up would cause additional power consumption. The
interrupt pin of this sensor is connected to BlueNRG-2 to exploit the smart embedded processing
functionality (single/double tap recognition, free-fall, wakeup, portrait/landscape, 6D/4D orientation detection;
activity/inactivity, stationary/motion detection; pedometer, step detector and step counter; up to 16 finite state
machines to process).
•The LPS22HH barometer interrupt pin exhibits the same behavior as the LSM6DSO interrupt pin: it is an
input pin at boot and must be low to activate the I2C interface. It can be configured as push-pull or opendrain after boot. The interrupt pin of this sensor is not connected to BlueNRG-2.
•The HTS221 relative humidity and temperature interrupt pin is push-pull at boot and can be reconfigured as
open-drain after boot. The interrupt pin of this sensor is not connected to BlueNRG-2.
•The VL53L1X time-of-flight proximity interrupt line is open-drain only and would require an external pull-up.
The interrupt pin of this sensor is not connected to BlueNRG-2.
The dynamics of the environmental parameters are relatively slow, so interrupts are not necessary. The
application only needs to wake up every few seconds and perform one-shot measurements with the LPS22HH
barometer or HTS221 relative humidity and temperature sensor, and trigger an action if specific conditions are
met.
It is also not convenient to keep the VL53L1X proximity time-of-flight sensor active, the power consumption or the
latency would be too high. The power consumption of VL53L1X ranges from 0.5 mA for 1 Hz measurements, up
to 7 mA for 10 Hz measurements.
UM2501
2.1.4Pinout descriptions
In the following figure, you can see 6 pads along the edge of the board:
•
RFTEST (4h) and GND (4g) connected to the RF section for test purposes.
•TEST (4e) connected to the analog TEST output of BlueNRG-2 for test purposes.
•VDD (4f) and GND (4c), for test purposes or to power additional external components.
•ADC (4d) to accept analog input signals from additional external components.
UM2501 - Rev 3
page 5/44
1a
2a
4a
5a
6a
2b
2c
2d
2e
2f
3b
4b
4c
4d
4e
4f
4g
4h
1b
5b
6b
7a
7b
8
RESETN
UART RX
UART TX
SWD CLK
SWD IO
IOIOIOIO
GND
BOOT
GND GND VDD
1
2
10
Features of the BlueNRG-2 device
•I2C SCL (4a) and I2C SDA (4b) to connect additional external components via I2C.
UM2501
Figure 4. STEV
1a. BlueNRG-2 Bluetooth 5.0 network and application processor 1b. BALF-NRG-02D3 integrated balun and matching network
2a. LPS22HH ambient pressure sensor 2b. LSM6DSO smart accelerometer and gyroscope 2c. LIS2MDL magnetometer 2d.
VL53L1X proximity by time-of-flight 2e. HTS221 relative humidity and temperature 2f. MP34DT05-A top-port digital microphone
3a. User button 3b. RGB LED
4a. I2C SCL 4b. I2C SDA 4c. GND 4d. ADC 4e. TEST 4f. VDD 4g. GND 4h. RFTEST
5a. II-network (not mounted) 5b. SMD antenna
6a. Inductor to enable lowest power BLE active mode 6b. 32kHz crystal to enable lowest power BLE sleep mode
7a. Battery holder 7b. CR2032 battery (not included)
8. 10-pin connector
FCC ID: S9NSTEBCN2V1 IC ID: 8976C-STEBCN2V1
AL-BCN002V1 sensor node front and rear components
On the debug connector on the rear of the board, there are 10 pins:
VDD (pin 2) and GND (pin 4, 6, 10) to accept power from the host motherboard.
•
•SWD IO (pin 1) and SWD CLK (pin 3) to Flash and debug through the host motherboard.
–SWD pins can be used as digital GPIOs when the BlueTile is not connected to its host board.
•UART TX (pin 5) and UART RX (pin 7).
–UART pins can be used as digital GPIOs when the BlueTile is not connected to its host board.
•BOOT (pin 8) and RESETN (pin 9) to control the boot and keep BlueNRG-2 under reset.
–The boot pin can also be used as a digital GPIO when the BlueTile is not connected to its host board,
but it needs to be pull-down at start-up.
2.2Features of the BlueNRG-2 device
BlueNRG-2 integrates a Bluetooth Low Energy radio (BLE), an ARM® Cortex®-M0 core, 12+12 kB of RAM,
UM2501 - Rev 3
256 kB of Flash memory
fast 400 kHz), UART interfaces; two multi-function timers (MFT), a DMA controller, RTC and watchdog, and an
ADC with PDM stream processor.
The public key cryptography (PKA) and random number generator (RNG) are reserved for the BLE protocol stack,
but the user application can also read the RNG.
The ADC is 10-bit and features single or continuous acquisition at max. 1 MHz sampling frequency, two single
ended or one differential signal (ADC1 and ADC2 pins), embedded channels for temperature and battery voltage
sensing, embedded digital filter with down sampling. The embedded digital filter can be used to process the PDM
stream from a digital MEMS microphone (1.6 MHz or 0.8 MHz) and convert it to audio PCM (8 kHz to 50 kHz
when 1.6 MHz clock is used for the microphone).
BlueNRG-2 uses the embedded digital filter of the ADC peripheral for PDM to PCM conversion when reading the
PDM output of the MEMS microphone MP34DT05-A.
, SPI (max 1 MHz in slave mode, 8 MHz in master mode), two I2Cs (standard 100 kHz or
page 6/44
The low-speed clock is used in low-power mode and can be supplied by the internal RC oscillator or by an
external crystal (32 kHz ±50 ppm). The high-speed clock is supplied by a fast-starting internal RC oscillator
(16 MHz) while the external crystal is starting up. The high-speed external crystal (16 or 32 MHz) is required to
enable the BLE radio.
Only the 32 MHz XO can support the highest computational loads, allowing the Cortex-M0, the DMA and the APB
tree to run at 32 MHz, while the rest of the clock tree runs at 16 MHz. When a 16 MHz XO is used, the Cortex-M0
and all the clock tree runs at 16 MHz.
2.2.1BlueNRG-2 states
•Preactive:
–
After power-on-reset, all digital power supplies are stable.
–Internal 16 MHz and 32 kHz RC oscillators are used.
–Reachable from Reset, Standby and Sleep states.
–Goes to Active state.
•Active:
–The external high-frequency crystal is used (16 MHz ±50ppm or 32 MHz) to enable BLE
communication.
–Internal 16MHz RC oscillator is switched off
–BlueNRG-2 uses a 32 MHz ±10ppm crystal (higher crystal accuracy = lower power consumption).
–The radio can be activated for transmission (TX) or reception (RX). This is the state used by
BlueNRG-2 when the user application is running or there is a BLE event to serve.
–The programmed GPIO configuration is restored.
–reachable only from Preactive only.
•Standby:
–RAM retention is used (12 or 24 kB).
–5 different GPIOs can be used to wake-up: IO9, IO10, IO11 with an internal pull-up; IO12, IO13 which
require an external drive).
–BlueNRG-2 IO11 is connected to the user button, IO12 connected to the interrupt pin of LIS2MDL
magnetometer, and IO13 connected to the interrupt pin of the LSM6DSO accelerometer and
gyroscope.
–Wake-up time is typically 200µs.
–reachable from Active.
–can go to Preactive.
•Sleep:
–RAM retention is used (12 or 24 kB).
–The low-frequency oscillator is switched on to serve periodic BLE connection events.
–5 different GPIOs can also be used to wake-up, as in Standby state.
–This is the state used by the BlueNRG-2 tile to save power when the user application is not running
and the device is waiting for a BLE event to serve.
–The programmed GPIO configuration is not maintained (this may affect connected sensors; for
example, see pin IO7 of BlueNRG-2 connected to XSHUT pin of VL53L1X).
–Reachable from Active.
–Can go to Preactive.
UM2501
Features of the BlueNRG-2 device
2.2.2BLE firmware stack and memory map
Program memory, data memory, registers and I/O ports are organized in a linear 32-bit address space.
•
The SRAM is divided in two banks:
–12 KB from 0x2000_0000 to 0x2000_2FFF (retention always-on).
–12 KB from 0x2000_3000 to 0x2000_5FFF (retention optional).
–The FULL BLE stack needs 9.6 KB of SRAM.
–The BASIC BLE stack needs 8.0 KB of SRAM.
UM2501 - Rev 3
page 7/44
UM2501
Inertial MEMS sensors
•The Flash is 256 KB from 0x1004_0000 to 0x1007_FFFF
–
The FULL BLE stack needs 77 KB, leaving 179 KB for the user application. The FULL BLE stack
supports concurrent peripheral and central roles (N=0,1,2 connections to other centrals and 8-N
connections to other peripherals), LE secure connections, controller privacy, and extended data length.
–The BASIC BLE stack needs 58 KB, leaving 198 KB for the user application. The BASIC BLE supports
the peripheral role only (1 connection to a central), legacy security only, no controller privacy and no
extended data length.
–The OTA manager for over-the-air firmware updates adds 10 KB to the size of the BLE stack.
The OTA manager may be independent of the user application, or embedded in the user application:
•When the OTA manager is independent of the user application, the Flash is divided in two sections:
1.A relatively small section for the OTA application; the size is the sum of the BLE stack size and the
OTA manager size.
2.A larger section for the user application.
•When the OTA manager is embedded in the user application, the Flash is divided in three sections:
1.A section that holds the current application; the size is the sum of BLE stack size, OTA manager size
and user application size.
2.A section for the new updated application; the size is the same as the first section.
3.A very small section for the reset application that decides decides which application to run after boot,
depending on what is available and valid in the first two sections.
An independent OTA manager leaves more room for the user application, but there is no application to run if the
update does not finish successfully.
An embedded OTA manager can still use the previous application if the update does terminate successfully, but
the space available for the user application is less than half the size of the Flash.
Note:After a successful update, the new application can be copied over the old application, or the role of the first two
sections can be exchanged.
2.3Inertial MEMS sensors
Each sensor is made of a Micro Electro Mechanical system (MEMS) with a sensing element and a dedicated
ASIC with analog acquisition chain, analog-to-digital converter (ADC), and digital signal processing (DSP) and
control logic.
2.3.1LSM6DSO 3D accelerometer and 3D gyroscope
2.3.1.1LSM6DSO interrupts
The LSM6DSO delivers best-in-class motion sensing able to support more sophisticated functionality than simply
orienting devices to portrait and landscape mode.
The following event-detection interrupts are supported:
•
Free-fall event:
–detected when acceleration data from all enabled axes are below threshold settings for a certain
duration
•Wake-up event:
–detected when the filtered data from any of the enabled axes are above threshold settings for a certain
duration
–choose between high-pass filtered data, slope detection filter (difference between consecutive
samples, divided by two), low-pass filtered data plus an offset for each axis, or unfiltered data plus an
offset.
•6D/4D orientation event:
–detected when an axis (positive or negative) is above the threshold setting, while the other two are
below the threshold for a certain duration
–4D is a subset of 6D; the Z axis is not used.
–choose between unfiltered data or low-pass filtered data
UM2501 - Rev 3
page 8/44
UM2501
Inertial MEMS sensors
•Single/double tap event:
–
detected when the output of the slope detection filter exceeds the threshold setting and then returns
below the same setting within a “shock” time interval
–double tap event is detected when a first tap is detected and a second tap is detected after a “quiet”
time interval, but before a maximum “duration” interval
–for reliable detection, configure the device to use a high sampling rate, like 400 Hz.
–if two or more enabled axes are over their respective thresholds, the axis with the highest priority
setting is used
–can be used to enable user interaction in addition to the button present on the BlueTile
•Activity/inactivity event:
–uses the same data as the wake-up event
–if inactivity is detected (data below the threshold setting for a certain time interval), the device
automatically goes to Low-power Mode and reduces the accelerometer sampling rate down to 12.5 Hz
to minimize power consumption
–if a wake-up event is detected, the device automatically returns to the programmed accelerometer
operating mode and sampling rate
–can be configured to put the gyroscope in power-down or sleep mode when the accelerometer is in
low-power mode
•Stationary/motion event
•a special activity/inactivity event in which event detection is the same, but the device does not change power
mode or sampling rate
2.3.1.2LSM6DSO advanced functionality
Certain digital processing blocks allow advanced functions and algorithms when the output data rate is 26 Hz or
higher
.
•Pedometer functions: step detector and step counter.
–when a step is detected, an interrupt is generated and a corresponding counter is incremented by 1
(max value is 65535)
–can also set the interrupt to only be triggered when at least one step is detected in a configurable time
interval
–de-bounce functionality to avoid false detections, where N consecutive steps are detected before the
first interrupt is generated (default is N=10)
–two additional blocks can facilitate the identification of false-positives:
only trigger when statistical data matches the walking pattern
adapt the embedded algorithm to slow pace walking patterns
•Significant motion detection: to signal a possible change in user location
–based on the pedometer function, which is automatically enabled
–interrupt is generated when the difference between the number of steps after initialization or reset is
higher than the de-bounce threshold (default is 10).
–function is reset after each interrupt
•Relative tilt detection
–generates an interrupt when there a change in the tilt of the device exceeds 35 degrees
–reference position is set when the detection logic is enabled and reset when the interrupt is generated
–detection logic requires a 2-second settling time after it is enabled or re-initialized
2.3.1.3LSM6DSO finite state machines
The LSM6DSO can run up to 16 simultaneous finite state machines (FSMs) that consist of a sequence of
instructions or actions (parameter setting, interrupt generation, etc.), or a RESET
•if the RESET condition is satisfied, the FSM returns to the reset point
•if the NEXT condition is satisfied, the FSM moves to the next instruction
•otherwise, the RESET-NEXT conditions are re-tested.
FSM data may be accelerometer, gyroscope, integrated gyroscope or external sensor data, and can be
decimated. A data vector consists of X, Y, Z values and a vector norm V (square root of sum of squares).
UM2501 - Rev 3
-NEXT condition:
page 9/44
Each FSM has the following features:
•
3 different 8-bit masks to allow tests on positive and negative values of X, Y, Z and V.
•3 different thresholds and 1 programmable hysteresis value that is automatically added to or subtracted from
the selected threshold based on the test condition.
•4 different counters/timers to manage event durations.
2.3.1.4LSM6DSO smart FIFO buffer
The LSM6DSO accelerometer has a first-in first-out (FIFO) data buf
words of 7 bytes each (1 tag byte plus 6 data bytes). The tag drives the decoding and includes a parity bit for
validation, while the data can derive from any combination of accelerometer, gyroscope, up to 4 external sensors,
embedded temperature sensor, timestamp counter and pedometer step counter. The data rates can be set
independently for each source.
For the accelerometer, you can choose to store high-pass filtered data, slope detection filter data, low-pass
filtered data or unfiltered data plus an optional offset (independent for each axis). The low and high-pass filters
are configurable.
For the gyroscope, you can enable a first optional high-pass filter, and a second optional and programmable lowpass filter.
To maximize the amount of data stored in the FIFO, you can enable an adaptive lossless delta pulse-codedmodulation (DPCM) compression algorithm for the accelerometer and the gyroscope data. When the difference
between consecutive data words is small, instead of sending a new data word (16 bits/axis), only the difference
with respect to the previous is sent (8 bits = 2:1 compression or 5 bits/axis = 3:1 compression).
When DPCM compression is enabled, it is also possible to select when DPCM is reset by storing uncompressed
data in the FIFO: never, every 8, 16 or 32 words. This is useful when the FIFO is used as a circular buffer
(Continuous mode) and words may be overwritten, as the decoder can only work if previous data words can be
traced back to an uncompressed data word for reference.
DPCM compression works on 3 data words (sampled at time t, t-1 and t-2) and introduces a latency of 2 data
words. The compression factor depends on the difference between a data word and the previous data word.
•When DPCM is disabled, the compression buffer is flushed and the output is the non-compressed data word
at time t-2, then data word at time t-1 and data words at current time t thereafter (tag “NC_T_2”, “NC_T_1”,
and “NC”).
•When DPCM is enabled, the first output is the non-compressed data word at time t-2 (tag “NC_T_2”), used
as the reference to start decoding. Subsequent outputs depend on D2 (difference between data word at t-2
and previous decoded word), D1 (difference between data word at t-1 and t-2), and D0 (difference between
data word at t and t-1):
–If any difference in D2 exceeds 128 LSB on any axis:
◦the uncompressed data word at time t-2 is written to the FIFO by storing the 16-bit signed value of
each axis (low and high bytes for X, Y and Z: XL XH YL YH ZL ZH, for a total of 6 bytes)
◦tag NC_T_2
–If any difference in D2 and D1 exceeds 16 LSB, but is within 128 LSB for all axes:
◦a 2:1 compression ratio is applied by storing the 8-bit signed difference to reconstruct 2 data
values for each axis at time t-1 and t-2 (D1x D1y D1z, then D2x D2y D2z, for a total of 6 bytes)
◦tag 2xC
◦the data at time t-2 is derived by summing D2 to the previously decoded data word
◦the data at time t-1 is derived by summing D1 to the data at time t-2 just derived
–If all differences in D2, D1 and D0 are within 16LSB for all axis:
◦a 3:1 compression ratio is applied by storing the 5-bit signed difference to derive 3 data values for
each axis at time t, t-1 and t-2 (D0x D0y D0z and a dummy bit to make 16 bits, then D1x D1y D1z
and a dummy bit, then D2x D2y D2z and a dummy bit, for a total of 6 bytes)
◦tag 3xC
◦the data at time t-2 is derived by summing D2 to the previous decoded data word
◦the data at time t-1 is derived by summing D1 to the data at time t-2 just derived
◦the data at time t is derived by summing D0 to the data at time t-1 just derived
Interrupts can be generated when the FIFO buffer stores a given number of samples (FIFO threshold level), or
when it is full, or when it overflows (overrun). The FIFO can work in the following modes:
UM2501
Inertial MEMS sensors
fer that can store up to 3 KB of data, or 512
UM2501 - Rev 3
page 10/44
Inertial MEMS sensors
•Bypass Mode:
–
the FIFO buffer is disabled and cleared
•FIFO Mode:
–the FIFO buffer collects data until it is full, then stops
•Continuous Mode:
–the FIFO buffer collects data continuously
–when it is full, the oldest samples are overwritten as in a circular buffer
–FIFO full and FIFO threshold level interrupts allow the host microcontroller to read the data before it is
overwritten
•Continuous-to-FIFO Mode:
–the FIFO buffer collects data continuously but switches to FIFO Mode as soon as the selected interrupt
occurs
–this mode is especially useful to capture data before and after a specific event
•Bypass-to-Continuous Mode:
–the FIFO buffer is disabled, but switches to Continuous Mode as soon as the selected interrupt occurs
–this mode is useful to capture data after an event has occurred
•Bypass-to-FIFO Mode:
–the FIFO buffer is disabled, but switches to FIFO mode as soon as the selected interrupt occurs
–this mode is useful to capture data after an event has occurred
–data collection stops once the FIFO is filled
UM2501
UM2501 - Rev 3
page 11/44
2.3.2LIS2MDL 3-axis magnetometer
2.3.2.1LIS2MDL dynamic range, resolution and accuracy
The LIS2MDL
Gauss if the magnetic field is not aligned with one of the axes), which is well above Earth’s magnetic field (which
is typically in the range of 0.25 to 0.65 Gauss).
The output is 16 bits (1.5 mGauss/LSB ±7%), and the RMS noise level in High-performance Mode is 3 mGauss
(2 LSB). The high resolution and accuracy allows e-compass orientation estimation and distance measurements
from a reference magnet (in its simplest form, the magnetometer can emulate a magnetically activated Reedswitch).
The LIS2MDL magnetometer can perform a single-shot measurement and then return to Power-down Mode, or
operate in Continuous Mode with a programmable sampling rate (10, 20, 50 or 100 Hz).
Single-shot measurements can be performed at max. 100 Hz in high-performance mode, or max. 150 Hz in lowpower mode. In low-power mode, the power consumption is reduced to 25%, while in high-performance mode the
RMS noise is halved. An optional low-pass filter can be activated to further reduce RMS noise, without increasing
the power consumption, the bandwidth in this case is reduced from output data rate ODR/2 down to ODR/4.
The LIS2MDL
an initial operating condition; a reset pulse may be used to enable the compensation of the intrinsic magnetic
offset.
•If intrinsic offset compensation is disabled, there is no reset pulse. The set pulse can be generated at poweron only (Set_FREQ=1), or every 64 measurements (Set_FREQ=0).
•If intrinsic offset compensation is enabled, set and reset pulses are generated alternately on consecutive
samples. After the set pulse, the measured output is the magnetic field H plus offset; after the reset pulse,
the measured output is H minus offset.
–In Continuous Mode, the device averages consecutive measurements to compensate for the offset, the
–output =
–In Single-shot Mode, the host microcontroller averages two consecutive measurements. The averaged
When intrinsic offset compensation is performed, the residual offset is in the range of ±60 mgauss, and the
dependency on temperature is ±0.3 mgauss/°C.
is a 3D digital magnetometer with a ±50 Gauss dynamic magnetic field range (reduced to ±25
is based on anisotropic magneto-resistive (AMR) technology, in which a set pulse is required to set
output will be equal to the magnetic field H.
ffset
H + o
+ H − offset
2
= H
measurements must occur within a short time of each other for the compensation to be ef
Hard-iron compensation is a constant offset added to magnetic field measurements to compensate distortion
caused by ferromagnetic materials or high currents. This of
analysing the output of the magnetometer.
When it is available, this offset can be programmed in specific registers (OFFSET_X_REG_H/L,
OFFSET_Y_REG_H/L, OFFSET_Z_REG_H/L) so that it is automatically subtracted by the LIS2MDL device.
RELATED LINKS
DT0059: Ellipsoid or sphere fitting for sensor calibration
MotionMC software library in the X-CUBE-MEMS1 Sensor and motion algorithm software expansion for STM32Cube
2.3.2.4LIS2MDL interrupt generation
The LIS2MDL
the subtraction of hard-iron offset) exceeds a programmed threshold (INT_THS_H/L_REG) in the positive or
negative direction.
Comparisons can be enabled independently for each axis (XIEN, YIEN, ZIEN flags):
•when the output data is above the positive threshold, the corresponding flag is set (P_TH_S_X/Y/Z)
•when the output data is below the negative threshold, the corresponding flag is set (N_TH_S_X/Y/Z).
A specific interrupt can be generated if there is a measurement range overflow at the internal ADC.
magnetometer sensor can be configured to generate an interrupt when output data (before or after
fset can be computed by the host microcontroller by
UM2501 - Rev 3
page 12/44
2.4Environmental MEMS sensors
2.4.1LPS22HH barometer
2.4.1.1LPS22HH acquisition chain
The LPS22HH pressure sensor can perform a one-shot measurement and then return to Power-down Mode, or it
can operate in Continuous Mode with a programmable sampling rate (1, 10, 25, 50, 75, 100 or 200 Hz).
Measurements can be taken in normal Low-noise Mode, or in Low-power Mode to minimize current consumption.
When continuous mode is selected, Low-noise Mode is not available at 100 and 200 Hz. In all cases, an optional
low-pass filter can be enabled with a programmable cutoff frequency to reduce the noise level (the bandwidth is
reduced from output data rate ODR/2 down to ODR/9 or ODR/20).
The low-pass filter is reset when it is enabled. After reset, a specific settling time is required before the first
accurate sample on the output is available (9 or 20 samples must be discarded, respectively).
Two programmable offsets can be subtracted from measured data:
•First, offset compensation (always): the offset measured with one-point calibration (OPC) can be stored in
specific registers (RPDS) and then subtracted from subsequent measurements (OPC-compensated data =
data – RPDS*256). The low-pass filter, if enabled, will filter OPC-compensated data. Filtered and unfiltered
OPC-compensated data is stored in the FIFO.
•Second, auto-zero mode (optional): the offset-compensated (and possibly filtered) pressure measurements
are stored in specific registers (REF_P) when auto-zero is enabled (AUTOZERO or AUTOREFP set to 1)
and then subtracted from subsequent measurements (AZ-compensated data = data – REF_P). Filtered and
unfiltered OPC-compensated data or AZ-compensated data is stored in output registers.
UM2501
Environmental MEMS sensors
2.4.1.2LPS22HH interrupt generation and FIFO buffer
The LPS22HH pressure sensor can be configured to generate interrupt events related to pressure acquisitions
and FIFO status (watermark reached, full, overrun, etc.).
The interrupt can be generated when a new pressure or temperature sample is available, or when the AZcompensated data exceeds a programmed threshold (THS_P) in the positive (PHE flag enables the comparison
with +THS_P) or negative (PLE flag enables the comparison with –THS_P) direction. The following configurations
are available:
1.
AUTOZERO=0 and AUTOREFP=0: interrupt logic is disabled; filtered and unfiltered OPC-compensated data
goes to FIFO and output registers.
2.AUTOZERO=1: interrupt logic is enabled; REF_P is set when interrupt is enabled; AZ-compensated data
goes to the interrupt logic and to the output registers, while filtered and unfiltered OPC-compensated data
goes to FIFO.
3.AUTOREFP=1: interrupt logic is enabled; REF_P is set when interrupt is enabled; AZ-compensated data
goes to interrupt logic, while filtered and unfiltered OPC-compensated data goes to FIFO and output
registers.
The FIFO buffer can store up to 128 pressure samples (24 bits each) and 128 temperature samples (16 bits
each). FIFO depth can be limited by stopping at the programmable watermark level. The FIFO can work in the
following modes:
•Bypass Mode:
–the FIFO buffer is disabled and cleared
•FIFO Mode:
–the FIFO buffer collects data until it is full or the watermark setting is reached, then stops
•Continuous (or Dynamic Stream) Mode:
–the FIFO buffer collects data continuously
–when it is full or the watermark setting is reached, the oldest samples are overwritten as in a circular
buffer
–FIFO full and FIFO threshold level interrupts allow the host microcontroller to read the data before it is
overwritten
UM2501 - Rev 3
page 13/44
Environmental MEMS sensors
•Continuous (Dynamic Stream)-to-FIFO Mode:
–
the FIFO buffer collects data continuously but switches to FIFO Mode as soon as the selected interrupt
occurs
–this mode is especially useful to capture data before and after a specific event
•Bypass-to-Continuous (Dynamic Stream) Mode:
–the FIFO buffer is disabled, but switches to Stream Mode as soon as the selected interrupt occurs
–this mode is useful to capture data after an event has occurred
•Bypass-to-FIFO Mode:
–the FIFO buffer is disabled, but switches to FIFO mode as soon as the selected interrupt occurs
–this mode is useful to capture data after an event has occurred
UM2501
UM2501 - Rev 3
page 14/44
Loading...
+ 30 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.