Related configuration of PWM frequency capture in STM32

Publisher:innovation2Latest update time:2018-07-01 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Let me first talk about frequency capture in general. According to my personal understanding, frequency capture uses a counter. When a timer interrupt occurs (it should be when the Autoreload register in the figure below is full), two values ​​are recorded in two adjacent timer interrupts. The difference between the captured signals is calculated. The final frequency is your timer clock divided by your captured value.


Of course, if you directly call the function in the PWM_Input routine in the official 3.5 library to capture directly, you will find that the measured value will be very inaccurate below about 980Hz (under STM32F103RBT6). At this time, you need to use TIM_TimeBaseInit() to configure the pre-scaling parameters in PSC and ARR. The following figure is attached


Two pictures after the Prescaler changes


ARR determines the value of the Autoreload register. The two pictures above show that after changing PSC, the timer clock line will slow down, which means that more signals can be detected after one cycle, and the frequency that can be measured will be lower.


Keywords:STM32 Reference address:Related configuration of PWM frequency capture in STM32

Previous article:Capturing PWM pulse width using STC14F104W microcontroller
Next article:stm32 timer input capture pwm

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号