8 Essential C Language Tips for Embedded Engineers

8 Essential C Language Tips for Embedded Engineers

As an engineer working with MCUs, we rarely encounter pure upper-level software development, nor can we fully engage in hardware circuit design. Our most common work mode is: A cigarette in the left hand, a soldering iron in the right, and both hands on the keyboard typing code. To create a good design, we must … Read more

Getting Started with Raspberry Pi: A Beginner’s Guide

Getting Started with Raspberry Pi: A Beginner's Guide

Preparing to write some tutorials on getting started with Raspberry Pi, this tutorial uses C language for teaching. It roughly involves the control of the GPIO pins of the Raspberry Pi, an introduction to Raspberry Pi, and specific examples of using GPIO pins. It is mainly aimed at beginners of Raspberry Pi. We use the … Read more

Understanding Byte Alignment in Linux

Understanding Byte Alignment in Linux

Recently encountered a problem where ThreadX running on ARM crashed while communicating with DSP using message queues (the final implementation principle is interrupt + shared memory). After investigation, it was found that the structure used for message passing did not consider the issue of byte alignment. Here’s a brief overview of byte alignment issues in … Read more

Mastering Microcontrollers: From Beginner to Expert

Mastering Microcontrollers: From Beginner to Expert

Many students mention learning microcontrollers, and they often have the following expression: Seeing others’ programs densely packed, they don’t know where to start. In fact, if you calm down and read others’ programs, you will find a certain pattern, which is often modular. Microcontrollers have a lot of registers, and it’s hard to remember what … Read more

Memory Optimization Techniques in Microcontroller Development (C Language Version)

Memory Optimization Techniques in Microcontroller Development (C Language Version)

First, let’s talk about As we all know, the biggest difference between microcontroller programming and computer programming is that microcontrollers have very limited resources, and most low-end microcontrollers do not have an operating system. Except for some embedded-level chips that use Linux, most operations are done with simple RTOS, and some simple applications or chips … Read more

Understanding the Distinction Between Embedded C Programming and Traditional C Language

Understanding the Distinction Between Embedded C Programming and Traditional C Language

When we first learn embedded development, a common question arises: what is the difference between C language and embedded C programming? Embedded engineers typically tell you that the difference lies in the fact that embedded C runs on embedded development boards, which differ from CPUs in computers, leading to different compilers and executable programs. Unlike … Read more

Understanding Bitwise Operations in Microcontroller Programming

Understanding Bitwise Operations in Microcontroller Programming

Previously, we discussed why microcontrollers should be programmed in C language and what programming environments are required. Today, we will introduce the basic knowledge of microcontroller programming. First, we need to introduce bitwise operations. Bitwise operations are very common when configuring microcontroller registers. For instance, when configuring the GPIO of a microcontroller to output direction … Read more

Understanding Why C Language is Used for Microcontroller Programming

Understanding Why C Language is Used for Microcontroller Programming

With the development of technology, electronic products are becoming more and more common, making our daily lives more convenient. Most electronic products have microcontrollers, which achieve functionality by executing software logic. While assembly language is the most suitable programming language for microcontroller programming, the most commonly used and widespread is C language. So, why should … Read more

How to Self-Learn STM32 Microcontrollers

How to Self-Learn STM32 Microcontrollers

Continuing to post my answer. First, you need a development board. If you are just starting in the field of microcontrollers, I recommend starting with videos. At the very least, you should have a book on C programming for reference on C language concepts. When you first start learning, focus on videos. For concepts that … Read more

Understanding Zero Division Operations in STM32 Microcontrollers

Understanding Zero Division Operations in STM32 Microcontrollers

This issue’s topic: As is well known, in C language, dividing a number by 0 will lead to a division operation exception, causing the program to crash. To avoid program crashes, we need to include checks for 0 in the code. However, when running C program code that performs division by zero on STM32 microcontrollers, … Read more