Simulating Standard UART Serial Port Using General I/O Ports

Simulating Standard UART Serial Port Using General I/O Ports

Frame The UART communication standard uses an 8-bit binary number as a frame, with the least significant bit first, transmitted bit by bit. To distinguish each frame, a 0 is used as a start marker before each frame, followed by a 1 as a stop marker. Before the stop marker, an optional “parity bit” can … Read more

Microcontroller Program to Control Stepper Motor

Microcontroller Program to Control Stepper Motor

Combining the key input program, we designed a functional program: Pressing the number keys 1 to 9 controls the motor to rotate 1 to 9 circles; using the up and down keys changes the rotation direction, pressing the up key rotates forward 1 to 9 circles, while the down key rotates backward 1 to 9 … Read more

How to Improve Your Coding Skills in Embedded Development

How to Improve Your Coding Skills in Embedded Development

When starting to learn about embedded systems or microcontroller systems, most people’s learning method is to find video tutorials or books to learn by themselves. Some may spend money to enroll in a training class to learn with a teacher. When you slowly become capable of writing code independently, you might feel like you have … Read more

How to Implement Layered Management of Applications and Hardware in MCU Projects

How to Implement Layered Management of Applications and Hardware in MCU Projects

This article mainly shares an open-source management module that helps achieve layered management of applications and hardware in an MCU project. Nowadays, project requirements are more complex, which naturally imposes stricter demands than before. From a technical perspective, I still recommend that everyone should maintain a layered structure (application and driver) in their projects. This … Read more

Understanding Microcontrollers: Advanced Techniques

Understanding Microcontrollers: Advanced Techniques

This Session’s Learning Implementing Two Lines of Different Content on LCD Using Code Knowledge Points for This Session: Understand how to achieve a two-line display effect on the LCD (the last learning session of microcontrollers this semester) Learning Tools: Computer, Keil uVision4 software, Proteus software Microcontroller Explanation After several weeks of studying microcontrollers, I believe … Read more

Exploring the Path of Microcontroller Development

Exploring the Path of Microcontroller Development

Introduction Microcontrollers are quite “low-level” and “hardware” components, lacking complex data structures and intricate programming algorithms. We only need to understand and program from the perspective of how the microcontroller executes. For the average person, there is no need to delve deeply into the subject, as most of us are merely users of microcontrollers, not … Read more

Using STM32 HAL Library for GPIO Control

Using STM32 HAL Library for GPIO Control

01 Introduction In the development of embedded systems based on STM32 microcontrollers, GPIO (General Purpose Input/Output) control is one of the most fundamental and common operations. By using the STM32 HAL library, configuring and controlling GPIO can be done easily. This article will demonstrate how to use the STM32 HAL library for GPIO control and … Read more

Easy Introduction and Practice with STM32 Microcontroller

Easy Introduction and Practice with STM32 Microcontroller

Introduction The STM32 series chips are developed based on the Cortex-M3 core. They adopt the industry-leading Cortex-M3 core architecture, utilizing Harvard architecture and the Thumb-2 instruction set. They can achieve 32-bit performance with a 16-bit code density. Additionally, with single-cycle multiplication instructions, hardware division instructions, and a built-in fast interrupt controller, STM32 chips can run … Read more

Step-By-Step Guide to STM32 General Timers (Part 1)

Step-By-Step Guide to STM32 General Timers (Part 1)

● General Timer (TM2~TM5) The general timer is managed by the chip and can perform up counting, down counting, or both simultaneously. Additionally, these timers have other functionalities: input capture, output compare, PWM, and single pulse. ● From Manual to Flow The main module of the timer consists of a 16/32-bit counter and its related … Read more

Detailed Analysis of GPIO Initialization Functions in STM32 HAL Library

Detailed Analysis of GPIO Initialization Functions in STM32 HAL Library

Reminder: This article provides a detailed analysis of the functions related to GPIO configuration in the HAL library, including MX_GPIO_Init(), HAL_GPIO_WritePin(), and HAL_GPIO_Init(). At the end of the article, a description of the f1 series GPIO port registers is attached. MX_GPIO_Init() First, let’s look at the source code: void MX_GPIO_Init(void){ GPIO_InitTypeDef GPIO_InitStruct = {0}; /* … Read more