Practical Analysis of Serial Protocol: A Detailed Explanation of Data and Business Logic Separation Design in MicroPython Using R60ABD1 Radar as an Example

Practical Analysis of Serial Protocol: A Detailed Explanation of Data and Business Logic Separation Design in MicroPython Using R60ABD1 Radar as an Example

Abstract: In this article, we take the R60ABD1 radar as a practical case to detail the design and analysis method of a custom serial communication protocol architecture in the MicroPython environment, focusing on the core of data parsing and business logic separation. We break down key aspects such as protocol encapsulation and command interaction, providing … Read more

Efficient Parsing of Variable-Length Data Frames in Embedded Communication Protocols

Efficient Parsing of Variable-Length Data Frames in Embedded Communication Protocols

I am Lao Wen, an embedded engineer who loves learning.Follow me to become even better together! In communication design, considering the flexibility of protocols, they are often designed to be “variable length”. An example is shown in the figure below: the communication protocol frame of the Ruimi LoRa terminal. If a system receives the above … Read more

Siemens S7-200smart PLC MODBUS RTU Communication Case Study

Siemens S7-200smart PLC MODBUS RTU Communication Case Study

1. TaskThe S7-200smart PLC reads the weight data from the weighing sensor via MODBUS-RTU communication.2. Device Model DataS7-200smart PLC:SR60 3. Introduction to MODBUS Master Station Commands4. Commands1. MODBUS Master Station Initialization Command2. Polling Method to Read Weight Value and Decimal PlacesUse the completion flag M10.0 of the initialization program and the completion flag M10.2 of … Read more

Practical Tools for Python Programming: Part One – Hot Series Search Tool

Practical Tools for Python Programming: Part One - Hot Series Search Tool

Hello, everyone! In the previous chapters, we learned about the Python Programming Practical Series. Let’s write more and get familiar with it; welcome to check out the new practical tools series. 1. Let’s get straight to the code """Hot Series Search Tool""" import requests import re import time from enum import Enum class SearchType(Enum): """Search … Read more

A Method for Parsing Data from Microcontrollers

A Method for Parsing Data from Microcontrollers

Source: https://blog.csdn.net/XR528787067/article/details/52822377 Recently, a friend of mine was communicating with a peripheral using a microcontroller, and the peripheral returned a series of data formatted as follows: AA AA 04 80 02 00 02 7B AA AA 04 80 02 00 08 75 AA AA 04 80 02 00 9B E2 AA AA 04 80 02 … Read more

The Concept of Union and Its Application in Embedded Programming

The Concept of Union and Its Application in Embedded Programming

The author has limited ability, and if there are any errors in the article, I would greatly appreciate it if friends could point them out. Thank you! Concept of Union In Chinese, a union is also referred to as a “共用体” (union), “联合” (joint), or “联合体” (joint body). Its definition format is the same as … Read more

The Concept of Union and Its Application in Embedded Programming

The Concept of Union and Its Application in Embedded Programming

The author has limited capabilities, and if there are any errors in the article, I would greatly appreciate it if friends could point them out. Thank you! Concept of Union In Chinese, a union is also referred to as a union type or a union structure. Its definition format is the same as that of … Read more

Building a Compiler with Rust and LLVM

Building a Compiler with Rust and LLVM

Cyclang is a simple statically typed programming language that supports basic language constructs such as functions, control flow, and arithmetic operations. The language’s feature design is very concise, and the complete language specification can be referenced in the official documentation. The focus of this project is on the process of building a compiler from scratch … Read more

Practical Knowledge of JSON Data in Embedded Systems

Practical Knowledge of JSON Data in Embedded Systems

JSON (JavaScript Object Notation) is a lightweight data interchange format. JSON is widely used in internet-related development, and it is also quite common in embedded systems. Recently, I used it in a project, and I would like to share my experience. An example of a simple JSON formatted data is as follows: { "name": "xxx", … Read more