Serial Port Communication Between the TYLC4 Module and MCU

Serial Port Communication Between the TYLC4 Module and MCU

I. Typical Application Diagram

Figure 1-1 and Figure 1-2 show communication between the TYLC4 module and MCU in Wi-Fi module processing mode. Figure 1-3 and Figure 1-4 show communication between the module and MCU in cooperative processing mode.

S1 indicates the Wi-Fi module reset button, and LED1 indicates the Wi-Fi module status indicator. The following table lists the default mappings between the LED1 status and working status of the Wi-Fi module.

LED1 Status LED1 Display Wi-Fi Module Status
Blinks quickly Flashes on and off at 250 ms intervals SmartConfig mode
Blinks slowly Flashes on and off at 1500 ms intervals AP mode
Steady on Steady on Connected to a router
Steady off Steady off Disconnected from a router

Figure 1-1 Communication between the TYLC4 module and a 5 V MCU in Wi-Fi module processing mode

Figure 1-2 Communication between the TYLC4 module and a 3.3 V MCU in Wi-Fi module processing mode

Figure 1-3 Communication between the TYLC4 module and a 5 V MCU in cooperative processing mode

Figure 1-4 Communication between the TYLC4 module and a 3.3 V MCU in cooperative processing mode

II. Design Description

  1. The voltage and current for the Wi-Fi module to work properly are 3.3 V and 100 mA, respectively. It is recommended that the current be 300 mA or higher and that the total capacitance of external filter capacitors be more than 10 μF when the voltage is 3.3 V. When the Wi-Fi module is transmitting or receiving RF signals at 3.3 V, the current is increased by over 50%.

  2. When designing the PCB layout, ensure that the filter capacitors C1 and C2 are as close to the VCC pin as possible.

  3. The default settings for connections between the serial ports (TXD and RXD) and MCU are as follows:

    Baud rate: 9600

    Data bit: 8

    Stop bit: 1

    Parity bit: none

    Flow control: none

    For details, see Tuya General Serial Port Communication Protocols. When the Wi-Fi module is powered on, the TXD pin prints the module startup information. Skip the information during module startup. To use the serial port as a common I/O port, contact Tuya R&D personnel.

  4. The RST pin resets the module at low level. To use the RST pin, connect it to the I/O port of the MCU and low level input.

  5. To use the module, you need a button and Wi-Fi status indicator.

    The button (S1 in Figure 1-1 and Figure 1-2) is used to clear the module’s network configuration. You can use the smart product’s network connection button.

    The indicator (LED1 in Figure 1-1 and Figure 1-2) indicates the working status of the Wi-Fi module or smart product.

    For details about the processing modes, see section 3.3 in Tuya General Serial Port Communication Protocols.

  6. If the input voltage of the MCU is 3.3 V, skip signal level conversion in Figure 1-1 and Figure 1-3.

  7. Other idle pins can be vacant.

400 Call

Consult

400-881-8611