How to Choose an MCU

How to Choose an MCU

In today’s article, let’s discuss how to choose an MCU. Let me share my thought process. 1. List the peripherals If a system has multiple MCUs, we need to allocate them properly, for example, temperature sensor on MCU #1, Bluetooth on MCU #2, etc. 2. Determine the communication interfaces of the peripherals Some peripherals support … Read more

Common I/O Ports of MCUs and Their Differences

Common I/O Ports of MCUs and Their Differences

When it comes to microcontrollers (MCUs), the first thing that comes to mind is that they have many input/output (I/O) ports, which can be difficult to distinguish. As the core of embedded systems, they can communicate with external devices or sensors. However, the presence of I/O ports often makes learning challenging for many people. This … 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

How to Handle Single Chip Select in STM32 SPI?

How to Handle Single Chip Select in STM32 SPI?

Previously, when using STM32’s SPI to control many external chips, there was only one chip select for a single SPI peripheral. How can we achieve independent chip selection for one master and multiple slaves? SPI Bus Topology Generally, the SPI bus is connected as shown in the figure below, with one master and multiple slaves. … Read more

Step-by-Step Guide to STM32 GPIO

Step-by-Step Guide to STM32 GPIO

GPIO, translated as General Purpose Input Output. I believe everyone is quite clear about the meaning of input and output. The most commonly used output function is the LED, while the most commonly used input function is the key. To use the GPIO functionality of STM32, the first thing to clarify is who controls this … Read more

Step-by-Step Guide to STM32 External Interrupts

Step-by-Step Guide to STM32 External Interrupts

● Interrupts Interrupts play a very important role in microcontrollers. The code executes from top to bottom by default, and when it encounters conditions or other statements, it jumps to specified locations. During the execution of code in a microcontroller, unexpected situations may arise that need to be handled, which will interrupt the current code. … 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

Detailed Explanation of STM32 Microcontroller GPIO Working Principles

Detailed Explanation of STM32 Microcontroller GPIO Working Principles

Introduction to STM32 GPIO GPIO stands for General Purpose Input/Output ports, which are pins that can be controlled by the STM32. GPIO pins connect to external hardware devices, enabling communication with external devices, controlling external hardware, or collecting data from external hardware. Taking the STM32F103ZET6 chip as an example, this chip has a total of … Read more

Introduction to Independent Key in STM32 IoT Kit

Introduction to Independent Key in STM32 IoT Kit

Click the blue text above: IoT Inn to follow us. In previous sections, we used the LED light, buzzer, and relay components, driven by the GPIO output function of STM32. In this section, we will learn about the GPIO input function. When an external button is pressed, the microcontroller can detect it in real-time. Buttons … Read more