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

Detailed Explanation of STM32 Delay Functions

Detailed Explanation of STM32 Delay Functions

In embedded development, delay operations are one of the most common and fundamental tasks. Whether initializing peripherals, waiting for sensor responses, or handling simple task scheduling, delay functions play a crucial role. This article will provide a detailed explanation of how to use the SysTick timer to achieve microsecond, millisecond, and second-level delays based on … Read more

Delay Solutions for Microcontrollers: Loop vs Timer

Delay Solutions for Microcontrollers: Loop vs Timer

In embedded development, delay functions are fundamental operations. However, when faced with microsecond-level precision requirements, the choice between loop delays and timer solutions directly affects system stability. 1. Loop Delay: A Legacy from the Bare-Metal Era Implementation Principle: Consumes CPU cycles through no-operation instructions (such as NOP) or decrement loops. Critical Flaw: Precision fluctuation > … Read more

FreeRTOS Operating System (8)

FreeRTOS Operating System (8)

Delay Functions Classification of delay functions: Relative delay: vTaskDelay Absolute delay: vTaskDelayUntil Relative delay Absolute delay Relative delay means that each delay starts from the task execution function vTaskDelay() and ends after the specified delay time. Absolute delay means that the task calls the vTaskDelayUntil() function at fixed intervals, in other words, the task executes … Read more