MCU Connection Solution

This topic describes the development process of an MCU connection solution, as a quick start guide for developers. This topic introduces the development process, starts with type selection, and provides the links of all documents required during development. For development tutorials of specific communication protocols, see the development overviews of corresponding solutions.

Overview

As one of the most frequently-used solutions to connect to the Tuya IoT Console, the MCU connection solution is mainly used to enable products with MCU to be smart. Tuya provides hardware modules, apps, and cloud services. You only need to focus on product function research and development and develop the smart products efficiently and quickly with Tuya MCU SDK, public version app, and panel.

Solution selection

The communication schematic diagram of MCU connection solutions is as follows.

Communication schematic diagram.png

Product creation

After you select a solution, you need to create a product in Tuya IoT Console and download MCU development documents. Tuya IoT Console is an online one-stop development platform, covering all the steps from product creation to mass production. There are four main steps.

1. Create a product

For more information about product creation, see Create Products.

2. Function definition

For more information about function selection, see Standard Functions. A data point (DP) is an abstract representation of product functions.

3. Select a panel

In an app, the control interface of a device is called a panel.

4. Download development documents

IoT Console recommends modules to you according to your product and communication solution. You can place an order online, or select another module according to actual requirements. For the module datasheet, see TYWE1S Module Datasheet.

Hardware.png

You can download MCU development documents including:

Development debugging

After the product is created, you can purchase module samples, download the software development kit (SDK) in the IoT Console, and enter development debugging. Click to view tutorials according to the protocols in the downloaded SDK.

The protocol development guides already provide detailed descriptions. Now, we will introduce the main processes and documents for development debugging.

Hardware debugging

After you receive the module sample, you can build a minimum system. With a Tuya host, you can configure the network, operate, and get to know the data interaction process of the protocol. For more information, see the following topics:

Software debugging

During software development, if MCU resources are adequate, it is recommended to migrate MCU SDK. After the underlying driver of the serial port works properly, the protocol connection does not need development. Therefore, the software development cycle is shortened substantially.

Different SDKs have different requirements for MCU hardware resources. For example, according to Wi-Fi MCU SDK, the Flash sector size must be 4 KB. RAM size is related to DP data length, and RAM is about 100 bytes.

If the OTA function is configured, RAM must be greater than 260 bytes. The function nesting level is 9 levels. In case of insufficient resources, you can implement connection protocols by yourself, and refer to functions in the SDK.

For more information about the software debugging, see Overview of migrating Tuya’s MCU SDK.

Joint debugging of functions

During joint debugging of functions, enter IoT Console > Operation to view background data and make decisions. For more information, see Operations Guide of Operation Center.

Tuya provides an online support service. If documentation fails to solve your question, raise your question online. Our professional technical team will be ready to help you.

For more information about the support center, see Tutorial for Tuya Support Center.