Advanced Embedded Programming | JavaScript Implementation of CRC16-MODBUS Function Code (Is DeepSeek Wrong?!?)

Advanced Embedded Programming | JavaScript Implementation of CRC16-MODBUS Function Code (Is DeepSeek Wrong?!?)

01Introduction: Let’s start with the correct code. We will use a six-byte array for testing: [0x0a, 0x03, 0x02, 0x00, 0x00, 0x16]. 02Function and Results 1. Function // Example with 0a 03 02 00 00 16 var buffer = [0x0a, 0x03, 0x02, 0x00, 0x00,0x16]; // Call the function to calculate the CRC checksum var crc = … Read more

Six Common Data Structures in Embedded Programming

Six Common Data Structures in Embedded Programming

Today, embedded systems are increasingly applied in various fields such as smart homes, smart healthcare, industrial automation, and intelligent transportation. In the development of embedded systems, data structures are an essential knowledge point. This article will introduce several common data structures in embedded programming, including arrays, stacks, queues, heaps, hash tables, and linked lists. 1. … Read more

Why C++ is Rarely Used in Microcontroller Development?

Why C++ is Rarely Used in Microcontroller Development?

Author | strongerHuang WeChat Official Account | strongerHuang When it comes to embedded programming, many people’s first impression is C/C++. However, you will find that microcontroller development is mostly done in C, with very few using C++. So, can C++ be used for microcontroller development? The answer is definitely yes. Based on Keil and STM32, … Read more

A Comprehensive Guide to C Language Pointers: Easy to Understand and Detailed!

A Comprehensive Guide to C Language Pointers: Easy to Understand and Detailed!

Today, I will explain pointers. From basic to advanced, this article will combine practical applications to help you learn pointers while understanding what experts use pointers for!Long article warning! The entire text is about 5200 words, and this article is enough to learn pointers!Many people, like me when I first learned C language, are afraid … Read more

MicroPython Embedded Programming Tools

MicroPython Embedded Programming Tools

MicroPython is one of the most popular topics in open-source hardware in recent years, invented by Professor Damien George from the University of Cambridge, and is essentially a version of the Python language used for embedded programming.One of the challenges in embedded programming is that programmers need to focus not only on the software but … Read more

Embedded Programming: Fast Context Switching Based on cpost with Code Link at the End

Embedded Programming: Fast Context Switching Based on cpost with Code Link at the End

The demands of embedded development programming are ever-changing. To achieve system stability and code reusability, high cohesion and low coupling must be maintained.It is generally believed that time-consuming operations cannot be executed within interrupts, as this would affect system stability. For programs with an operating system, interrupt handling can be divided into two parts through … Read more

Methodology for Building Embedded Programs from Code and Toolbox for Hardware Debugging

Methodology for Building Embedded Programs from Code and Toolbox for Hardware Debugging

How to Build Embedded Programs and Find Documentation 1. Define the Purpose For example, if I want to configure a peripheral, I need to first understand how to drive this peripheral, its structure, enumerations, and what methods are available, etc., and whether there are examples to refer to. 2. Find the Core Structure <span>esp-hal</span> library … Read more

Why C++ is Rarely Used in Microcontroller Development?

Why C++ is Rarely Used in Microcontroller Development?

Follow+Star Public Account Number, don’t miss out on exciting content Author | strongerHuang WeChat Public Account | strongerHuang When it comes to embedded programming, many people’s first impression is C/C++. However, you will find that microcontroller development is mostly done in C, with very few using C++. So can C++ be used for microcontroller development? … Read more

Embedded Software Programming: How to Improve Code Portability?

Embedded Software Programming: How to Improve Code Portability?

I am Lao Wen, an embedded engineer who loves learning.Follow me, and let’s become better together!For experienced developers, writing code with an emphasis on portability is essential, not only for the convenience of others but primarily for oneself, to avoid creating pitfalls.Here, I will share some key points on enhancing the portability of embedded code.1. … Read more

Advanced Embedded Programming | How to Prevent RAM or FLASH from Overloading?

Advanced Embedded Programming | How to Prevent RAM or FLASH from Overloading?

01Introduction: When developing with microcontrollers, issues related to RAM or FLASH usage often arise. Below, we analyze the factors affecting RAM and FLASH usage and how to optimize them. 02Analysis of RAM Usage Factors 1. Variable Storage Global Variables/Static Variables (Global Lifetime) uint32_t global_counter = 0; // Initialize global variable (occupies .data segment RAM) uint8_t … Read more