CBx Series Modules

Last Updated on : 2024-06-20 07:18:36download

This topic describes information about implementing serial communication between CBx series modules and MCUs.

Overview

CBx series, including CBU, CB1S, CB3S, and CB3L, is a Wi-Fi and Bluetooth Low Energy (LE) combo module. It supports both the access point (AP) mode and station (STA) mode for Wi-Fi connection as well as a connection over Bluetooth LE.

Serial protocol

Serial communication between module and MCU

  • Connection between a module and a 3.3V MCU

    CBx Series Modules
  • Connection between a module and a 5V MCU

    In the following circuit diagram, voltage level translation can be implemented with a bidirectional voltage-level translator, a MOS transistor, or a triode.

    CBx Series Modules

Level translator reference

  • N-channel MOSFET level translator: An N-channel MOSFET and a built-in body diode are used to implement two-way communication.

    CBx Series Modules
  • NPN triode level translator: An NPN triode is used to implement one-way communication.

    CBx Series Modules

Design specification

Serial port pin

The following table lists the specification and pin information of CBx modules for serial communication with an MCU.

Module model Input voltage (TYP) Input current (MAX) TX pin No. TX silk screen RX pin No. RX 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

Power supply

  • The supply current for 3.3V modules must be greater than the maximum input current. The total capacity of the external filter capacitor must not be less than 10 μF.
  • Place the filter capacitors C1 and C2 near the power pin of the module.

Pins of the module

  • The GPIO might experience an uncontrollable high level within five milliseconds of starting the module (before the program startup). Place a 4.7 kΩ pull-down resistor if needed.
  • 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 a module has been paired, this pin cannot be used to clear pairing information.
  • The CSN pin on the module is used to select a mode. Pulling CSN down before the module is powered on will start the test firmware, while floating it or pulling it up will start the application firmware. This pin is connected to P21 on the IC. It is not recommended to use this pin as GPIO. You can leave it floating or add a pull-up resistor.
  • Other unused pins can float.
  • For more information about pin configuration, see module datasheet.

Power-on sequence of the module

  • Suppose that the high-level voltage settling time of the module’s GPIO is t2 and the voltage settling time of the module power pin is t1. Every time the module is powered on, t2 must be greater than or equal to t1. Circuit diagram

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

    • To return the module to its normal state, pull down the module reset pin (RST/CEN) for one millisecond and pull up to restart the module.
    • Repeatedly power cycling the module power pin will not restore it to its normal state.

Antenna clearance

  • Do not use metal shells or plastic shells with metallic paint or coating in the direction of the antenna radiation. Do not use metal objects such as screws and rivets near the antenna, which might affect the antenna efficiency.

  • Try to increase the distance from the top shell to the antenna to minimize the impact on antenna performance.

    CBx Series Modules
  • Try to increase the distance from the upper and bottom shells to the antenna to minimize the impact on antenna performance.

    CBx Series Modules
  • 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 performance and ensure isolation from interference.

Placement

  • Horizontal placement

    We recommend that you place the module at the edge of the backplane with the antenna facing outward, and flush the module’s GND terminal with the backplane’s GND terminal. Both terminals are fully connected.

    CBx Series Modules
  • Embedded placement

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

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

    CBx Series Modules
  • Vertical placement

    Insert the module vertically into the backplane slot with the antenna facing upward. The module’s GND terminal and the backplane’s GND terminal must be fully connected. We recommend that you keep a clearance distance of 15 mm or more around the antenna.

Low power design

Option 1: Control module power pin on/off

This circuit design can achieve overall low power consumption.

CBx Series Modules
  • How it works: As shown in the circuit diagram, the MCU can control the switch S1 with the GPIO pin to power on/off the module.

    • When the MCU has data to report to the cloud, it turns the S1 on. Then, the module can receive data from the MCU and report data to the cloud and the mobile app.
    • When data reporting is completed, the module will be powered off and consume no power.
  • Disadvantages:

    1. Current sinking occurs. When the switch S1 is turned off, the TXD and RXD pins on the module are still connected to the RXD and TXD pins on the MCU.
    2. Therefore, the current from the MCU can flow into the VCC pin of the module through the UART pin.
    3. The TXD and RXD pins of the module are high, so the current sinking will increase the consumption of the module.
    4. When the switch S1 is turned on next time, t2 will be less than t1, which can cause the module to be frozen.
  • Solution 1: Optimize the software of the MCU without hardware modification. When the MCU detects the data reporting is completed, the program proceeds with the following steps.

    1. Set the TXD and RXD pins of the MCU as GPIO pins that are configured as the open-drain or weak pull-down mode.

    2. Turn the switch S1 off to power off the module.

    3. This way, when the MCU has data to report, it turns the S1 on firstly.

    4. Then, it configures the TXD and RXD pins as the UART to establish communication with the module for data transmission.

      This solution does not apply to MCUs whose UART pin cannot be configured as the open-drain or weak pull-up mode. If the UART circuit has a pull-up resistor, one terminal of the resistor must be connected to the VCC pin of the module, or you can directly remove this resistor.

  • Solution 2: Add a level translator to the circuit without software modification. See the circuit diagram in the preceding sections Level translator reference and Connection between a module and a 3.3V MCU and embed a level translator in the UART circuit.

Option 2: Reduce power usage in idle state

Pull down the module’s clock enable (CEN) pin or reset (RST) pin to reduce idle consumption.

CBx Series Modules
  • How it works: As shown in the circuit diagram, the MCU can control the CEN or RST pin with the GPIO pin to power on/off the module.

    • When the MCU has data to report to the cloud, the GPIO outputs high to power on the module. Then, the module can receive data from the MCU and report data to the cloud and the mobile app.
    • When data reporting is completed, the GPIO outputs low and the module runs in reset mode with low power consumption.
  • Disadvantage: The CEN or RST pin has a 10 kΩ internal pull-up resistor, so the module has an input current of 330 μA in the reset mode.

Radio frequency (RF) test

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 final test. The RF test items and metrics are listed in the following table.

Test item Test metric
Increasing indoor distance ≥ 25 m
Increasing outdoor distance ≥ 75m
Total radiated power (TRP) in the signaling mode of end devices (test mode of 11B 1 Mbit/s). ≥ 10 dBm
Total isotropic sensitivity (TIS) of end devices ≤ -62 dBm
  • TRP and TIS must be tested in a dark chamber of the antenna manufacturers or certified organizations.
  • The test items apply to most Wi-Fi products, excluding certain special products.