Last Updated on : 2023-05-15 07:37:34download
This topic describes information about implementing serial communication between CBx series modules and MCUs.
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.
Connection between a module and a 3.3V MCU
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.
N-channel MOSFET level translator: An N-channel MOSFET and a built-in body diode are used to implement two-way communication.
NPN triode level translator: An NPN triode is used to implement one-way communication.
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|
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
t2 is less than
t1, the module might fail to start.
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.
Try to increase the distance from the upper and bottom shells to the antenna to minimize the impact on antenna performance.
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.
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.
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.
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.
This circuit design can achieve overall low power consumption.
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.
S1on. Then, the module can receive data from the MCU and report data to the cloud and the mobile app.
S1is turned off, the TXD and RXD pins on the module are still connected to the RXD and TXD pins on the MCU.
S1is turned on next time,
t2will 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.
Set the TXD and RXD pins of the MCU as GPIO pins that are configured as the open-drain or weak pull-down mode.
Turn the switch
S1 off to power off the module.
This way, when the MCU has data to report, it turns the
S1 on firstly.
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.
Pull down the module’s clock enable (CEN) pin or reset (RST) pin to reduce idle consumption.
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.
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.
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|
Is this page helpful?YesFeedback
Is this page helpful?YesFeedback