ST Microelectronics STEBCN2V1 User Manual

ST Microelectronics STEBCN2V1 User Manual

UMXXX

UMxxxx

User manual

STEVAL-BCN002V1 User Manual

1. Introduction

The STEVAL-BNC002V1 is an BLE-enabled sensor node. The STEVAL-BCN002V1 platform includes the following components: inertial and environmental digital MEMS sensors, a digital MEMS microphone, a time-of-flight proximity sensor, and a BLE wireless system-on-chip with a Cortex-M0 core that can run the user application and the radio stack (BLE or proprietary), to enable communication with any device equipped with BLE.

The BLE-enabled sensor node can be seen as a small form-factor reference design, ready to be extended and customized. It is also a development platform, to test and develop BLEenabled applications exploiting the BlueNRG-2 SDK. Finally, it is an evaluation tool, to evaluate the performance of the sensors and the capabilities of the BLE. Thanks to the small and thin form factor, it can be used in the field for data collection campaigns, to develop new custom algorithms.

Figure 1. STEVAL-BCN002V1 BLE-enabled sensor node.

UMXXX

Figure 2. STEVAL-BCN002V1 battery holder and SWD connector

2. Features

The STEVAL-BCN002V1 includes the following components and features:

BLUENRG-2 Bluetooth low-energy wireless system-on-chip: the device includes an ultra low-power ARM Cortex-M0 MCU with 256KB Flash and 24KB RAM with retention, plus an extensive range of enhanced I/O and peripherals (10bit ADC, 2 general purpose 16bit timers, watchdog and RTC, DMA controller, PDM stream processor, 2 I2C, 1 SPI, 1 UART, up to 26 GPIOs). The embedded Cortex-M0 runs at 32MHz and supports the radio stack and the user application. The device support BLE 5.0 stack and proprietary 2.4GHz stack. The device can work with an external 16 or 32MHz crystal, and with an internal 32kHz ring oscillator or an external 32kHz crystal (which enable lowest power sleep mode). The device includes an integrated linear regulator and a DC-DC converter (requires an external inductor and enables lowest power active mode). Power consumption down to 1uA with active BLE stack (sleep mode); 1.9mA when CPU is running, RAM and Flash on (active mode); 8.3mA TX peak current at -2dBm output power. Up to +8dBm output power, up to

UMXXX

96dB link budget.

BALF-NRG-02D3 50ohm nominal input / conjugate match to BlueNRG transceiver with integrated harmonic filter.

LSM6DSO inertial digital module with 3-axis accelerometer and 3-axis gyroscope. Ultra-low power (0.55mA in combo high-performance mode at the highest datarate, 6.6kS/s). Configurable free-fall, wakeup, 6D/4D orientation detection (to support portrait and landscape mode detection), single/double tap recognition; automatic detection for activity/inactivity and stationary/motion condition; advanced algorithms for pedometer, step detector and step counter; significant motion and relative tilt; up to 16 finite state machines (FSM) to process accelerometer, gyroscope or external sensor data. User selectable full scale of 2, 4, 8 or 16g and 125, 250, 500, 1000 or 2000dps; output data rates from 12.5 to 6600Hz, bandwidth up to 3kHz. The device includes 9KB FIFO buffer for 2 internal sensors and up to 4 external sensors.

LIS2MDL ultra low-power high-performance 3-axis magnetic digital sensor, 50 Gauss magnetic dynamic range. Selectable resolution/power trade-off. Output data rate up to 150Hz. RMS noise down to 3mgauss in high-performance mode with low-pass filter active. Embedded intrinsic offset cancellation. Embedded registers for hard-iron offset subtraction. Configurable interrupt.

LPS22HH ultra-compact piezo-resistive absolute pressure digital sensor, 2601260hPa, digital output barometer, full-mold, holed LGA package. The sensing element, which detects absolute pressure, consists of a suspended membrane manufactured using a dedicated process developed by ST.

HTS221 capacitive digital sensor for relative humidity and temperature. The sensing element consists of a polymer dielectric planar capacitor structure capable of detecting relative humidity variations and is manufactured using a dedicated ST process.

MP34DT05-A compact low-power omnidirectional digital top-port microphone with a capacitive sensing element; 0.2% THD+N and 64dB signal-to-noise ratio at 1kHz and 94dBSPL, 0.7% THD+N at 1kHz and 110dBSPL, 122.5dBSPL acoustic overload point, -26dBFS +/-3dB sensitivity, PDM output (1.2 to 3.25MHz), up to 24kHz bandwidth.

VL53L1X long distance ranging Time-of-Flight sensor based on ST’s FlightSense™ technology. 940nm class 1 laser emitter, 16x16 SPAD receiving array with integrated lens (27deg field of view). Ranging frequency from 1 to 50Hz

UMXXX

(repeatability improves at lower data rate, 2.5mm standard deviation with 200msec measurement); Ranging distance from 4cm to 400cm (under 4cm the device will detect a target but measurement will not be accurate). Ranging error within 20mm.

Figure 3. STEVAL-BCN002V1 block diagram

3.System architecture

The BLE sensor node is powered by a coin-cell battery (CR2032). The voltage is NOT regulated because all sensors and the BlueNRG-2, they can all operate at the voltage range of the battery. Moreover, the BlueNRG-2 has its own embedded linear power regulator and switching mode power converter (DC-DC).

POWER 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). The BLE sensor node includes the inductor needed by the DC-DC converter to enable the lowest power consumption in active mode:

Active mode, CPU Flash and RAM on, LDO regulator: RX 14.5mA at 3V, TX 17.2mA when output power is +2dBm, range is 12-28.8mA when output is -14 to +8dBm

Active mode, CPU Flash and RAM on, DC-DC converter: RX 7.7mA at 3V, TX 9mA at 3V when output power is +2dBm, range is 6.6-15.1mA when output is -14 to +8dBm

The BlueNRG-2 in sleep mode can use the internal 32kHz ring oscillator (RO) or an external 32kHz crystal oscillator (XO). The BLE sensor node includes the 32kHz crystal oscillator

UMXXX

to enable the lowest power consumption in sleep mode:

Sleep mode, 32kHz RO (Ring oscillator), 24kB RAM retention: 2.1uA at 3V

Sleep mode, 32kHz XO (Crystal oscillator), 24kB RAM retention: 0.9uA at 3V

RADIO FREQUENCY SECTION

The Radio Frequency section of the BLE sensor node includes three elements:

The first element is BALF-NRG-02D3, an ultra-miniature balun which integrates matching network and harmonics filter.

The second element is a Π-network which provides the flexibility to get additional filtering and also provides access points for testing. This network is not populated as the integrated balun provides the necessary matching.

The third element is the SMD 2.4GHz antenna which needs a specific clearance area on the PCB and specific passives for perfect tuning (FT1, FT2 and MT).

MEMS SENSOR SECTION

The Sensor section of the BLE sensor node includes inertial and environmental MEMS sensors connected to BlueNRG-2 by means of an I2C bus operated at 400kHz.

The MEMS microphone is connected to BlueNRG-2 using a dedicated line to transfer the PDM (Pulse Density Modulated) stream at 1.6MHz. The PDM stream is converted to PCM (Pulse Coded Modulation) by the integrated digital filter included in the ADC block on BlueNRG-2.

All sensors can generate interrupts, but in the BLE sensor node, only two interrupt pins are connected to BlueNRG-2 using dedicated and independent lines: the interrupt from the LIS2MDL magnetometer and the interrupt from the LSM6DSO accelerometer and gyroscope.

The LIS2MDL magnetometer interrupt line is only push-pull and must have its own independent line. The interrupt pin of this sensor is connected to BlueNRG-2 to enable applications such as “reed-switch” (switch activated by an external magnet).

The LSM6DSO smart accelerometer and gyroscope interrupt pin is an input at boot. It has an internal pull-down. 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 an additional power consumption. The interrupt pin of this sensor is connected to BlueNRG-2 to fully exploit the “smart” embedded processing (single/double tap recognition, free-fall, wakeup, portrait/landscape, 6D/4D orientation detection; activity/inactivity, stationary/motion

UMXXX

detection; pedometer, step detector and step counter; up to 16 finite state machines to process

The LPS22HH barometer interrupt pin is the same as for LSM6DSO: it is an input pin at boot and must be low so that I2C interface is activated. It can be configured as push-pull or open-drain 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 only open-drain and would require an external pull-up. The interrupt pin of this sensor is not connected to BlueNRG-2.

From the application point of view, the dynamic of the environmental parameters is very slow. Therefore, an interrupt need not be used. The application can wake-up on a regular basis, every few seconds, perform one-shot measurements with the LPS22HH barometer or HTS221 relative humidity and temperature sensor, and trigger the corresponding action if specific conditions are met.

Also, from the application point of view, it is not convenient to keep the VL53L1X proximity time-of-flight sensor active, waiting for a gesture and a corresponding wake-up interrupt. The power consumption or the latency would be too high. The power consumption of VL53L1X ranges from 0.5mA for 1Hz measurements, up to 7mA for 10Hz measurements.

4. BlueNRG-2 features

BlueNRG-2 integrates a Bluetooth Low Energy radio (BLE), an ARM Cortex-M0 core, 12+12kB of RAM, 256kB of Flash memory and several peripherals: SPI (max 1MHz in slave mode, 8MHz in master mode), 2x I2C (standard 100kHz or fast 400kHz), and UART interfaces; 2x multi-function timer (MFT), DMA controller, RTC and watchdog, ADC with PDM stream processor.

The public key cryptography (PKA) and random number generator (RNG) are reserved for the BLE protocol stack, however the user application can also read the RNG.

The ADC features are: 10-bit, single or continuous acquisition at max 1MHz sampling frequency, 2x single ended or 1x 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 coming from a digital MEMS microphone (1.6MHz or 0.8MHz) and convert it to audio PCM (8kHz to 50kHz when 1.6MHz clock is used for the microphone). The BlueNRG-2 sensor node

UMXXX

does exploit the embedded digital filter of the ADC peripheral for PDM to PCM

conversion when reading the PDM output of the MEMS microphone MP34DT05-A.

The low-speed clock is used in low-power mode and can be supplied by the internal RC oscillator or by an external crystal (32kHz +/-50ppm). The high-speed clock is supplied by a fast-starting internal RC oscillator (16MHz) while the external crystal is starting up. The high-speed external crystal (16 or 32MHz) is strictly required to enable the BLE radio.

In order to support the highest computational load, the 32MHz XO must be used. When 32MHz XO is used, the Cortex-M0, the DMA and the APB tree run at 32MHz while the rest of the clock tree runs at 16MHz. When 16MHz XO is used, the Cortex-M0 and all the clock tree runs at 16MHz.

BlueNRG-2 states

Preactive (reachable from Reset, Standby or Sleep, goes to Active): after power- on-reset, all digital power supplies are stable; internal 16MHz and 32kHz RC oscillators are used.

Active (reachable only from Preactive): the external high-frequency crystal is used (16MHz +/-50ppm or 32MHz) to enable BLE communication; the internal 16MHz RC oscillator is switched off; the higher the accuracy of the crystal, the lower the power consumption is; the BlueNRG-2 sensor node uses a 32MHz +/-10ppm crystal. In active mode 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.

Standby (reachable from Active, can go to Preactive): RAM retention is used (12 or 24kB); 5 different GPIOs can be used to wake-up (IO9, IO10, IO11 which have an internal pull-up, and IO12, IO13 which require an external drive); the BlueNRG-2 sensor node uses IO11 connected to the user button, IO12 connected to the interrupt pin of LIS2MDL magnetometer, and IO13 connected to the interrupt pin of of LSM6DSO accelerometer and gyroscope. The wake-up time is typically 200us.

Sleep (reachable from Active, can go to Preactive): RAM retention is used (12 or 24kB); the low-frequency oscillator is switched on to serve periodic BLE connection events; as in Standby state, 5 different GPIOs can also be used to wake-up. 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.

BLE FIRMWARE STACK AND MEMORY MAP

Program memory, data memory, registers and I/O ports are organized in a linear 32-bit address space.

UMXXX

The SRAM is divided in two banks

O 12KB from 0x2000_0000 to 0x2000_2FFF, retention always-on

O 12KB from 0x2000_3000 to 0x2000_5FFF, retention optional

OThe FULL BLE stack needs 9.6KB of SRAM; see below for FULL BLE stack features.

OThe BASIC BLE stack needs 0.0KB of SRAM; see below for BASIC BLE stack features.

The Flash is 256KB from 0x1004_0000 to 0x1007_FFFF

OThe FULL BLE stack needs 77KB, leaving 179KB for the user application; the FULL BLE stack will support 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, extended data length.

OThe BASIC BLE stack needs 58KB, leaving 198KB for the user application; the BASIC BLE stack will support only the peripheral role (1 connection to a central), only legacy security, no controller privacy and no extended data length.

OThe OTA manager to enable over-the-air firmware updates adds 10KB to the size of the BLE stack. The OTA manager may be independent of the user application, or it may be embedded in the user application.

When the OTA manager is independent of the user application, the Flash is divided in two section. The first relatively small section is dedicated to the OTA application; the size is the sum of BLE stack size and OTA manager size. The second large section is dedicated to the user application and is made of the rest of the Flash. This has the advantage of leaving the largest space to the user application, but it has the disadvantage that there is no application to run if the update is not completed successfully.

When the OTA manager is embedded in the user application, the Flash is divided in three sections. The first section is dedicated to the current old application; the size is the sum of BLE stack size, OTA manager size and user application size. The second section is dedicated to the new updated application; the size is the same as the first section. The third very small section is dedicated to the reset application; the reset application decides which application to run after boot, depending on what is available and valid in the first two sections. This has the advantage that even if the update is not completed successfully, there will always be a valid old application to run. The disadvantage is that the space available for the user application is less than half the size of the Flash. Note that after a

UMXXX

successful update, the new application can be copied over the old application or the role of the first two sections can be exchanged.

5. Inertial MEMS sensors features

Each sensor is made of two parts: the first is the Micro Electro Mechanical system (MEMS) which includes the sensing element; the second is the dedicated ASIC with the analog acquisition chain, the analog-to-digital converter (ADC), and the dedicated digital signal processing (DSP) and control logic.

LSM6DSO INTERRUPT GENERATION

The LSM6DSO delivers best-in-class motion sensing that can detect orientation and gestures in order to empower application developers and consumers with features and capabilities that are more sophisticated than simply orienting their devices to portrait and landscape mode.

The event-detection interrupts enable efficient and reliable motion tracking and contextual awareness, implementing hardware recognition of free-fall events, 6D orientation, click and double-click sensing, activity or inactivity, stationary/motion detection and wakeup events.

Free-fall event: when the device is in free fall, acceleration data is near zero. The user can define a threshold and a duration. The free-fall event is detected if data from all enabled axis is under the programmed threshold for the minimum programmed duration.

Wake-up event: the user can choose to one of the following: high-pass filtered data, the output of the slope detection filter (the slope is the computed as the difference of consecutive samples, divided by two), low-pass filtered data summed with a programmable offset (independent for each axis), or unfiltered data summed with the programmable offset; the low/high-pass filters are configurable; the wake-up event is detected if the filtered data from any of the enabled axis is over the threshold for the minimum programmed duration.

6D/4D orientation event: the user can choose to use unfiltered data or low-pass filtered data (the low-pass filter is the same as mentioned above); a specific 6D orientation is detected when one axis (positive or negative) is above the programmed threshold, while the other two are below the threshold, for the minimum programmed duration; 4D is a subset of 6D: in this configuration the Z axis is not used.

Single/Double tap event: the single tap event is detected when the output of the slope detection filter exceeds the programmed threshold and then returns below it within the programmed “shock” time window (the high-pass filter is the same as

UMXXX

mentioned above); the double tap event is detected when a first tap is detected, and a second tap is detected after the programmed “quiet” time window but before the maximum “duration” time window; for a reliable detection of short duration shock events, it is suggested to configure the device to use a high sampling rate (e.g. 400Hz). If more than one axis is enabled, and they are over their respective threshold, the highest priority axis is used; the priority can be configured.

Activity/Inactivity event: uses the same data as selected for the wake-up event; if inactivity is detected (data below the programmed threshold for the programmed duration), the device automatically goes to low-power mode and reduces the accelerometer sampling rate down to 12.5Hz to minimize power consumption; if activity is detected (wake-up event) the device automatically returns to the programmed accelerometer operating mode and sampling rate. This feature may be configured to put the gyroscope in power-down or sleep mode when the accelerometer is in low-power mode.

Stationary/Motion event: is a particular case of Activity/Inactivity event; event detection is the same but the device does not change in power mode or sampling rate.

Single/double tap recognition may be used to enable user interaction in addition to the use of the button present in the BlueNRG-2 sensor node. The on-board LED can be used to give feedback to the user.

LSM6DSO INTERRUPT GENERATION AND ADVANCED FUNCTIONS

Specific digital processing blocks enable advanced functions and algorithms: pedometer functions with step detector and step counter, tilt detection, significant motion detection. These functions require the output data rate to be 26 Hz or higher.

Pedometer functions: step detector and step counter. An interrupt is generated whenever a step is detected and the corresponding counter is incremented by 1 (max value is 65535). Optionally the interrupt can be generated only if at least one step is detected in a configurable time interval. In order to avoid false detections, N consecutive steps must be detected before the first interrupt is generated (debounce functionality), when this happens the counter is incremented by N. the parameter N is configurable. Two additional blocks can be enabled to enhance the rejection of false-positives: the first block enable the step detection only is statistical data matches the walking pattern; the second block adapts the embedded algorithm to slow pace walking patterns. STMicroelectronics provides the software tools to generate specific pedometer configurations based on data logs. The step counter is not reset to 0 when the accelerometer is configured to power-down

UMXXX

mode, or the step counter is disabled or re-initialized. The step counter can be reset explicitly by the user application.

Significant motion detection: this function generates an interrupt when there is a change in user location, computed by integrating accelerometer data.

Relative tilt detection: this function generates an interrupt when there is a change in the tilt of the device. The interrupt is generated when the change in tilt exceeds 35 degrees. The reference start position is set when the detection logic is enabled and it is reset when the interrupt is generated. The detection logic requires a 2 second settling time after it is enabled or re-initialized.

LSM6DSO FINITE STATE MACHINES

The LSM6DSO can have up to 16 FSM running concurrently. Each FSM is composed by a sequence of instructions where each instruction is an immediate action (parameter setting, interrupt generation, etc) or a RESET-NEXT condition. If the reset condition is satisfied, the FSM goes back to the programmed reset point; if the next condition is satisfied, the FSM moves to the next instruction; otherwise the RESETNEXT conditions are re-tested. Each FSM can be configured independently. FSM data can be one of the following: accelerometer, gyroscope, integrated gyroscope or external sensor data. Data can be decimated. Data vector is made of X, Y, Z values and a vector norm V (square root of sum of squares). Each FSM has 3 different 8-bit masks to enable tests on positive and negative values of X, Y, Z and V; also, each FSM has 3 different thresholds and 1 programmable hysteresis value which is automatically added or subtracted to the selected threshold based on the test condition; finally, each FSM has 4 different counters/timers to manage events’ durations.

LSM6DSO SMART FIFO BUFFER

The LSM6DSO accelerometer has a first-in first-out data buffer (FIFO) which can store up to 3KB of data: 512 words of 7 bytes each; the first byte is a tag followed by six bytes of data. The tag in the word drives the decoding. The tag includes a parity bit for validation. The data source can be any combination of the following: the accelerometer, gyroscope, up to 4 external sensors, embedded temperature sensor, timestamp counter and the pedometer step counter. The data rates can be set independently for each source.

For the accelerometer: the user can choose to store high-pass filtered data, the output of the slope detection filter, low-pass filtered data or unfiltered data summed with an optional and programmable offset (independent for each axis); the low/high-pass filters are configurable.

For the gyroscope: the user can choose to enable a first optional high-pass filter, and a second optional and programmable low-pass filter.

Loading...
+ 24 hidden pages