How printf() Works with UART Peripheral Driver Functions

How printf() Works with UART Peripheral Driver Functions

Today, I will share with you the hardware UART peripheral debugging output mechanism under IAR. In the embedded world, outputting print information is a very common auxiliary debugging method. With the help of print information, we can easily locate and analyze program issues. There are many ways to implement print information output in embedded application … Read more

How to Write I2C Driver Functions from Scratch

How to Write I2C Driver Functions from Scratch

Many people do not know how to write programs by looking at timing diagrams. Below, we will analyze a non-standard I2C device and teach everyone how to write an efficient IO simulation of I2C timing. Observing the timing diagram, it includes the I2C start signal, I2C stop signal, I2C acknowledgment, non-acknowledgment, response acknowledgment, as well … Read more

Learning I2C Protocol – Hardware I2C Implementation

Learning I2C Protocol - Hardware I2C Implementation

Initial Implementation of Hardware I2C Based on Standard Library 1. Introduction to Basic Library Functions of Hardware I2C void I2C_DeInit(I2C_TypeDef* I2Cx); void I2C_Init(I2C_TypeDef* I2Cx, I2C_InitTypeDef* I2C_InitStruct); void I2C_StructInit(I2C_InitTypeDef* I2C_InitStruct); void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState); void I2C_SendData(I2C_TypeDef* I2Cx, uint8_t Data); uint8_t … Read more

Introduction to ARM Bare-Metal Programming and Embedded Systems

Introduction to ARM Bare-Metal Programming and Embedded Systems

Introduction to ARM Bare-Metal Programming and Embedded Systems Getting Started with ARM Bare-Metal Programming: From Zero to Embedded Development Hello everyone, I’m Daodao. Today, let’s talk about ARM bare-metal development. Many beginners feel overwhelmed when they see ARM, thinking it’s particularly difficult. In fact, it’s not; once you grasp the essentials, writing a simple LED … Read more

Implementing CAN Bus Communication Protocol in Embedded C

Implementing CAN Bus Communication Protocol in Embedded C

For training, consulting, or project development, please contact 【Thought】 Readers of this public account must be familiar with the CAN communication protocol. Have you ever wondered how these signals are implemented in the communication protocol within the Electronic Control Unit (ECU) when collecting CAN bus signals and analyzing data? This content introduces how to implement … Read more

Implementation of Communication Protocols in Industrial Automation Using C

Implementation of Communication Protocols in Industrial Automation Using C

Implementation of Communication Protocols in Industrial Automation Using C Introduction With the development of industrial automation, the demand for communication between various devices, sensors, and control units is increasing. In this context, communication protocols have become an essential foundation for data exchange among different systems. The C language, with its efficiency and low-level characteristics, is … Read more

Optimizing Program Size in Embedded C/C++ Development: Structure Optimization

Optimizing Program Size in Embedded C/C++ Development: Structure Optimization

Optimizing Program Size in Embedded C/C++ Development: Structure Optimization In <span>C</span> and <span>C++</span> programming, the memory layout of structures (<span>struct</span>) has a significant impact on program performance and memory usage, especially in embedded development where <span>RAM</span> is limited to <span>16K</span>, <span>8K</span>, or even <span>4K</span>; every byte counts, and there is no room for waste. This … Read more

An Overview of Makefile, Kconfig, and .config in Linux Kernel Source

An Overview of Makefile, Kconfig, and .config in Linux Kernel Source

The Linux kernel source code contains numerous files, and understanding the relationships between Makefile, Kconfig, and .config is crucial for navigating the kernel compilation system. Issues arise when trying to compile and modify the kernel, integrate your own drivers, or configure the kernel. All of these problems relate to Makefile, Kconfig, and .config. Below, I … Read more

General Makefile Application Guide for Advanced Embedded Programming

General Makefile Application Guide for Advanced Embedded Programming

Introduction For development on Windows, many IDEs integrate compilers, such as Visual Studio, providing a “one-click compile” feature, allowing the user to compile, link, and generate target files with just one operation after coding. Linux development differs from Windows; the gcc/g++ compiler is generally used in Linux. If developing Linux programs for ARM, the arm-linux-gcc/arm-linux-g++ … Read more

Using Makefile for Simulation Process

Using Makefile for Simulation Process

Generally speaking, a makefile is a file that defines one or more execution rules and methods and is executed by the make command. This section will provide a simple and direct explanation of makefile and illustrate its application in the IC design simulation process. Makefile Definition The rules for writing a makefile are as follows: … Read more