English
English
简体中文
Contact Us
Register
Log In
layoutIndex

CBx Module

Last Updated on : 2022-05-20 08:20:04download

This topic describes information about CBx modules to implement MCU connection development.

Overview

CBx modules are low-power embedded combo modules developed by Tuya Smart. Both Wi-Fi and Bluetooth Low Energy (Bluetooth LE) are supported. This type of module supports connections to access points (APs) and stations (STAs) and enables connections over Bluetooth LE.

Serial communication protocol

Serial Communication Protocol
Serial Communication Protocol for Low Power Consumption
Serial Communication Protocol for HomeKit

Serial communication between a module and an MCU

  • Connections between a module and a 3.3V microcontroller unit (MCU)

    CBx Module

  • Connections between a module and a 5V MCU
    In the following figure, voltage level shifting can be implemented with a bidirectional level shifter chip, a MOS transistor, or a triode.

    CBx Module

Reference diagrams of level shifting circuits

  • Shifting circuit with an n-type metal–oxide–semiconductor (NMOS) transistor
    In this example, an NMOS transistor and a built-in body diode are used to implement two-way communication.

    CBx Module

  • Shifting circuit with a negative-positive-negative (NPN) triode
    In this example, an NPN triode is used to implement one-way communication.

    CBx Module

Design specification

Pin definition

The following table lists the specifications of CBx modules, including the pins that are used for serial communication with an MCU.

Module model Input voltage (TYP) Input current (MAX) Transmitter pin No. Transmitter silk screen Receiver pin No. Receiver silk screen
CBU 3.3V 380 mA 15 TX1 16 RX1
CBU-IPEX 3.3V 380 mA 15 TX1 16 RX1
CB1S 3.3V 342 mA 2 TXD1 3 RXD1
CB3S 3.3V 342 mA 16 TXD1 15 RXD1
CB3L 3.3V 380 mA 16 TXD1 15 RXD1
CB2S 3.3V 342 mA 7 TX1 5 RX1
CB8P 3.3V 380 mA 9 TX1 10 RX1

Module power supply

  • We recommend that you apply the supply current that is higher than the maximum input current to the 3.3V module. The total capacity of the external filter capacitor exceeds 10 μF.
  • Filter capacitors C1 and C2 at the power supply pin are arranged near the power supply pin.

Module pin

  • The reset pin or enable pin of the module is a hardware reset pin. The module has internal weak pull-up resistors configured. If the pin is not used, it can float. If the module has been paired, this pin cannot be used to clear pairing data.
  • The CSN pin of the module is the mode selection pin. Before power-on, pull it low to enter the test firmware, and float or pull it high to enter the application firmware. It corresponds to P21 of the IC. During normal use, it is not recommended to be used as a GPIO port. The pins can be left floating or a pull-up resistor can be added.
  • Other idle pins can also float.
  • For more information, see the module datasheet.

Power-on time series of the module

  • Each time the module is powered on, the setup time t2 of the high-level voltage of the module’s GPIO pin must be greater than or equal to the setup time t1 of the voltage for the module’s power supply pin, as shown in the figure below.

    CBx Module

  • If t2 is less than t1, the module might fail to start.

    In this case, even if you repeatedly power on and off the power supply pin of the module, the module cannot be restored to the normal working state.

    However, you can pull down the hardware reset pin (RST/CEN) of the module for 1 ms and then pull up again to restart the module and put it into the normal working state.

Antenna clearance

  • Avoid using metal shells and metal shells with metallic painting or coating in the direction of the antenna radiation. Avoid using metal screws, metal rivets, or other metal parts that affect the antenna radiation.

  • The distance from the top cover to the antenna affects the antenna performance. A longer distance decreases the impact on the antenna performance.

    CBx Module

  • The distance from the top shell and bottom shell to the antenna affects the antenna performance. A longer distance decreases the impact on the antenna performance.

    CBx Module

  • Keep the module away from speakers, power switches, cameras, HDMI, USB, and other high-speed signals to avoid interference.

  • Avoid metal shielding near the antenna. If co-channel interference occurs, you must evaluate the impact on the antenna and ensure the isolation from the interference.

Placement

  • Horizontal placement

    It is recommended to place the module at the edge of the backplane with the antenna facing outward, and flush the module GND with the backplane GND that are fully connected with each other.

    CBx Module

  • Embedded placement

    Embed the module into the backplane through a slot that is flushed with or deeper than the module ground. The side of the slot must be 15 mm or farther from the module board edge.

    A wider slot can achieve better performance but weaker than that of horizontal placement.

    CBx Module

  • Vertical placement

    Insert the module into the backplane slot vertically with the antenna facing upward. The module GND and the backplane GND shall be fully connected with each other. In an ideal condition, the clearance around the antenna is ≥ 15 mm.

Low-power design

  • Control the power-on and power-off of the power supply pin of the module to achieve a low power consumption of the finished device.

    CBx Module

    As shown in the figure, the MCU controls the switch S1 through the GPIO port to power on and power off the module. When there is data to be reported, the GPIO port controls the switch S1 to be powered on. At this time, the module is powered on and establishes a serial connection. And then, the MCU synchronizes the data to the cloud and the client through the module. When the data reporting is completed, the GPIO port controls the switch S1 to disconnect. The module is powered off, without power consumption.

    Disadvantages: When the switch S1 is disconnected, the module is powered off, and the TXD pin and RXD pin of the module are still connected to those of the MCU. At this time, the power flows through the UART pin of the MCU to the UART pin of the module, and then flows back to the VCC pin of the module. The TXD pin and RXD pin of the module are still at a high level. The current backflow will increase the power consumption of the module. Next time when S1 is turned on, the module is powered on. The setup time of the high level of TXD and RXD pins of the module is earlier than the setup time of the power supply pin voltage of the module, causing the module to crash.

    Solution 1: The hardware is not changed, and the MCU software is optimized. When the MCU detects that the task of reporting data to the cloud and the client is completed, the MCU program also needs to follow the steps below.

    1. First, set the TXD and RXD pins of the MCU as ordinary I/O ports, and they are in the open-drain state or weak pull-down state.
    2. The GPIO port controls the switch S1 to disconnect. The module is powered off.
    3. When the data needs to be reported next time, the MCU first powers on S1 through GPIO. The module is powered on.
    4. The MCU then configures TXD and RXD with UART functions, establishes communication, and reports data.

    This solution does not apply to the situation where the MCU serial pins cannot be configured as open-drain or weak pull-down states. If there is a pull-up resistor on the serial port link, one end of the pull-up resistor needs to be connected to the VCC pin of the module, or the pull-up resistor must be removed.

    Solution 2: The MCU software is not changed. Add a level shifting circuit to the hardware. For the level shifting circuit, see the previous Reference diagrams of level shifting circuits. Follow the 3.3V MCU diagram in Serial communication between a module and an MCU and embed the level shifting circuit in the serial port link.

  • By pulling down the CEN or RST pin of the module, reduce the power consumption when the module is not working. This way, achieve low power consumption of the finished device.

    CBx Module

    As shown in the figure, the MCU controls the CEN or RST pin of the module through the GPIO port. This way, power on and off the module. When there is data to be reported, the GPIO port outputs a high level. At this time, the module is powered on and establishes a serial connection. And then, the MCU synchronizes the data to the cloud and the client through the module. When the data reporting is completed, the GPIO port outputs a low level. The module is reset, with low power consumption.

    Disadvantages: There is a 10K pull-up resistor inside the CEN or RST pin of the module. When the module is in the reset state, the input current of the module is still 330 μA.

RF test items and metrics

The antenna is susceptible to the distance from the shell to the surrounding components. We recommend that you test the radio frequency (RF) performance after the finished device test. The RF test items and indicators are listed in the following table.

No. Test item Test metric
1 Indoor distance increasing ≥25 m
2 Outdoor distance increasing ≥75 m
3 Total radiated power (TRP) of finished device signaling mode (11B 1 Mbit/s test mode) ≥10 dBm
4 Total isotropic sensitivity (TIS) of a finished device ≤-62 dBm
  • Items 3 and 4 must be tested in a dark chamber of the antenna manufacturer or certification authorities.
  • The test items apply to most Wi-Fi products, excluding certain special products.