Low Power Services

Last Updated on : 2024-06-24 08:13:31download

Integration of the standard Bluetooth Low Energy (LE) protocol supports low power services, enabling you to develop low power products.

Overview

Bluetooth LE modules work in standard power mode and low power mode. The two working modes have the following characteristics:

  • Standard power mode: The advertising interval is about 100 ms, which is not configurable currently. The two-way serial communication works.

  • Low power mode:

    • In low power mode, the Bluetooth module automatically switches between sleep and running states based on Bluetooth events or peripheral events such as serial ports.

    • The Bluetooth module can keep advertising or stay connected in a low power state. The advertising interval is about one second, set by the MCU. If the interval is 0, advertising is turned off. Otherwise, the preset interval shall prevail.

    • The module will automatically switch to the running state when periodic advertising events or connection events occur, and perform other necessary operations that are only possible in the running state, such as sending data through a serial port.

    • The module does not receive serial data in low power mode. Therefore, when the module is in low power mode, the MCU needs to wake up the module through the wake-up pin before sending serial data to the module.

      After BK3432 enters low power mode, it will proactively disconnect from Bluetooth and turn off advertising.

Features

The wake-up features vary by chip and product category. For more information, see the feature comparison table below:

  • The MCU can pull down or up the low power pin on the module to make the module enter or exit the low power mode. Lowpower_module_enable indicates whether you need to use the command 0xE5 to enable low power mode, as shown in the following table.

    Chip (Category) Lowpower_module_enable Module_wakeup_pin Wakeup_level Idle_level
    TLSR825x (all) Need TL_B5 High Low
    PHY6222 (all) Need P26 High Low
    BK3432 (all) Need P03 (configurable) High Low
    BK3431Q (locks) Not need P03 High Low
    NRF52832 (locks) Not need IO11 Low High
    FR8016 (all) Need PA0 High Low

    After the module wakes up, a 100 ms time delay before serial communication is recommended. After waking up from deep sleep, Telink based modules need one second for startup.

  • To send data to the MCU, the module will wake up the MCU with the wakeup_level and then wait for a specified time before starting serial transmission. After data is sent, the wake-up pin will go back to the Idle_level, as shown in the following table.

    Chip (Category) Lowpower_module_enable Wakeup_mcu_pin Wakeup_level Idle_level
    TLSR825x (all) Need TL_D2 High Low
    PHY6222 (all) Need P31 High Low
    BK3432 (all) Need / / /
    BK3431Q (locks) Not need P10 High Low
    NRF52832 (locks) Not need IO14 Low High
    FR8016 (all) Need PA1 High Low

    For more information about the wake-up time, see Configure MCU wake-up (0xB0).

    The wake-up pin configuration varies depending on chipset platforms. Do not leave the wake-up pin on the MCU floating.

Related protocols

The protocols in this section are applicable to all Bluetooth LE generic firmware, and some protocol interfaces are only available on the new firmware. The actual firmware features shall prevail.

Enable low power feature (0xE5)

  • If the Lowpower_module_enable of your module is Need, the MCU must send this command to the module to enable the low power feature. Then, control the working mode of the module through Module_wakeup_pin.
  • Note that enabling the low power feature does not immediately put the module into low power mode. The specific power mode depends on the voltage level of the low power pin on the module.
  • The configuration is stored in the nonvolatile memory.

The MCU sends the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE5
4
5
2 Data length 0x00
0x01
6 1 Data Specifies whether to enable the low power feature. Valid values:
  • 0x00: Disable low power feature
  • 0x01: Enable low power feature
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

The module returns the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE5
4
5
2 Data length 0x00
0x01
6 1 State Return value
  • 0x00: Success
  • Other values: Failure
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

Configure system timer (0xE4)

  • This feature deals with the module’s capability to maintain the system timer in low power mode.
  • To further reduce the power consumption in sleep mode, you can use this command to turn off the system timer. Even if the system timer is turned off, the module still has the timekeeping capability in normal mode.
  • The power savings from turning off the system timer might vary depending on the chip. Power consumption can be reduced by a few microamps on some platforms, but power saving might be relatively limited on other platforms.
  • The system timer is turned off by default, and the configuration is stored in the nonvolatile memory.

With both the timer and advertising turned off, the Telink-based module can enter deep sleep with the power consumption reduced to 3 μA. After waking up, the module will restart.

The MCU sends the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE4
4
5
2 Data length 0x00
0x01
6 1 Data Specifies whether to enable the system timer. Valid values:
  • 0x00: Turn off system timer
  • 0x01: Turn on system timer
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

The module returns the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE4
4
5
2 Data length 0x00
0x01
6 1 State Return value
  • 0x00: Success
  • Other values: Failure
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

Configure the module wake-up pin (0xE3)

  • This command only applies to the BK3432 generic firmware.

  • You can use this command to set the custom pin to wake up the module from sleep. You can invoke this command after the UART initialization to configure the custom pin.

  • The configuration is stored in the nonvolatile memory.

    Since the module stops receiving serial data in the low power mode, the MCU must send this command within one second after the module is powered on, or before enabling the low power feature.

The MCU sends the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE3
4
5
2 Data length 0x00
0x06
6 to 11 6 Payload data CFG See the following table
12 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

Payload in CFG format

4 bytes 1 byte 1 byte
PIN_NUM Reserved Reserved

PIN_NUM is a reserved field in big-endian format. It is not parsed so you can set it to 0xff or 0x00. If you have any questions about PIN_NUM, submit a service ticket.

Example:

  • Set the P03 on BK3432 as the wake-up pin. The PIN_NUM for P03 is 0x03.

    55 AA 00 E3 00 06 00 00 00 03 00 00 EB

  • Set the P11 on BK3432 as the wake-up pin. The PIN_NUM for P11 is 0x11.

    55 AA 00 E3 00 06 00 00 00 11 00 00 F9

    The configurable pins on BK3432 are P02, P03, P04, P05, P10, P11, P12, P13, P34, P14, P35, P32, and P31. The PIN_NUM for Pxx on BK3432 is 0xxx.

The module returns the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xE3
4
5
2 Data length 0x00
0x01
6 1 State Return value
  • 0x00: Success
  • Other values: Failure
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

Configure MCU wake-up time (0xB0)

  • You can use this command to set the time (t) used for waking up the MCU from sleep.

    The module pulls up or down the wake-up pin for a specified time (t) before sending data to the MCU.

  • After modification, you must verify whether the specified time works. If not, you need to set a larger value.

  • You can invoke this command after the MCU receives the command 0x02 (55 aa 00 02 00 00 01). The configuration is stored in the volatile memory so it will reset to default when the module is turned on or restarted.

The MCU sends the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xB0
4
5
2 Data length 0x00
0x01
6 1 interval See the description below
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

interval indicates the wake-up interval in units of 10 milliseconds. The value ranges from 1 to 20, which means 10 ms to 200 ms.

Example:

  • 55 aa 00 E2 00 01 00 E2, indicating advertising is turned off in low power mode.
  • 55 aa 00 E2 00 01 06 E8, indicating the advertising interval is 600 ms in low power mode.

The module returns the following data.

No. Bytes Field Description
0
1
2 Header 0x55
0xAA
2 1 Version number 0x00
3 1 Command (CMD) 0xB0
4
5
2 Data length 0x00
0x01
6 1 State Return value
  • 0x00: Success
  • Other values: Failure
7 1 CRC8 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder

FAQs

Q: What are the common considerations?

A: When connecting low power products, you need to pay attention to the following matters:

  • Each time connected to the mobile app or gateway, the Bluetooth module will automatically sync its clock with the server. The accuracy of the module’s internal clock depends on the quality of the crystal oscillator. If you need the module to provide high-precision time, be sure to measure the accuracy of the module’s internal clock.

    If you have any questions about measuring clock accuracy, submit a service ticket. The internal clock is reset after the power is turned off.

  • When the supply voltage is below the operating voltage, operations on the flash memory of the module might cause errors in firmware or user data. You can take the following steps to protect the module in this use case:

    • When the MCU detects a low battery level, it powers off the module or turns off advertising and makes the module enter sleep mode.
    • When the module detects a low battery level, it enters sleep mode.