STM32 UART DMA Reception

STM32 UART DMA Reception

Introduction When sending data via UART, we clearly know the timing and quantity of the data being sent, making it relatively straightforward to handle. However, the timing and quantity of data received via UART are often unknown, requiring more consideration in handling. There are generally several methods to handle the issue of reception timing: Polling: … Read more

[RTOS] The Night Before Scheduling: Analysis of Interrupt Failure in FreeRTOS

[RTOS] The Night Before Scheduling: Analysis of Interrupt Failure in FreeRTOS

Phenomenon Before FreeRTOS starts scheduling with <span>vTaskStartScheduler()</span>, if FreeRTOS APIs (such as creating semaphores) are called, it will lead to interrupts managed by FreeRTOS being disabled until scheduling begins. Source Code Analysis In the FreeRTOS API, there are critical sections like this: // Common code snippet in FreeRTOS source: entering and exiting critical sections BaseType_t … Read more

Embedded Universe – Protocol Series – Serial Communication

Embedded Universe - Protocol Series - Serial Communication

Connecting the “Meridians” of Microcontrollers: Discussing Serial Communication Getting Acquainted: What is Serial Communication? Imagine you have a message to tell your friend across the room. You have two ways to do it: Shouting: Sending out 8 messengers at once, each holding a sign to spell out the complete message. This is parallel communication, fast … Read more

Angular Timer from the Perspective of PIC Microcontrollers

Angular Timer (AngTMR_Angular Timer) is also known as an angular interval counter. It is a peripheral independent of the core, configured in some specialized, relatively high-end MCUs, such as PIC16F161X. The Angular Timer can divide periodic signals into smaller time intervals and convert time-based signals into angle/phase-based signals. For example, the hour, minute, and second … Read more

Smart Lock System Based on STM32: A Classic Introduction and Timer Review

Now we have reached the configuration of the timer and the review of the interrupt demonstration, preparing adequately for the subsequent project.Question:The timer is provided with a clock frequency of 84MHz,please configure a 100KHz PWM waveform with a duty cycle of 30%. How should the timer be configured? Think about it first.First, from the information … Read more

Characteristics of Interrupts and Wake-up Mechanisms in 6502 Assembly

1. Maskable Interrupts (IRQ) Can be enabled/disabled by setting the I bit in the status register Typically used for interrupt requests from external devices Automatically saves the PC and P registers to the stack upon response 2. Non-Maskable Interrupts (NMI) Cannot be disabled by software Usually used for emergencies (e.g., power failure) Has a higher … Read more

Introduction to Various OBs in Siemens PLCs

1. Basic Concept of OB Definition: An Organization Block (OB) is a program block called by the CPU operating system to perform specific functions. Users write programs in the corresponding OB, and the CPU automatically executes it when the corresponding event occurs. Priority: Each OB has a different priority. A high-priority OB can interrupt a … Read more

Using Semaphores in FreeRTOS for STM32F103 Serial Data Transmission

Using Semaphores in FreeRTOS for STM32F103 Serial Data Transmission

1. Development Software: CubeIDE.2. Hardware Involved: STM32F103C8T6 minimum system board, ST-LINK v2 (STM8 & STM32), USB TO TTL (CH340). As shown below (for reference only):Connection Circuit Diagram:(1) STM32F103C8T6 <—> ST-LINK v2SWCLK <—> SWCLK; SWD <—> SWDIO ;3V3 <—> 3.3V ; GND <—> GND.(2)STM32F103C8T6 <—> USB TO TTLA10 <—> TXD ; A9 <—> RXD;3V3 <—> 3V3 … Read more

Comparison and Analysis of Interrupts and Core Independent Peripherals in Microcontrollers

Comparison and Analysis of Interrupts and Core Independent Peripherals in Microcontrollers

CIP (Core Independent Peripheral, independent of the core peripherals) functionality has been discussed in previous articles. CIP can alleviate some of the workload of the interrupt system, but it cannot completely replace it. Both have their own advantages and disadvantages in terms of operational characteristics, and this article provides an analysis of their pros and … Read more

Understanding Interrupts in Microcontrollers

Understanding Interrupts in Microcontrollers

1. What is an Interrupt? — A Simple Understanding Let’s start with a real-life example: You are writing a blog when suddenly your boss sends a message asking you to handle an urgent task immediately. So, you pause your blog work, complete your boss’s task, and then return to writing your blog. This is the … Read more