STM32 timer learning---basic timer

Publisher:码农闲散人Latest update time:2018-08-17 Keywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The STM32F1 series products, in addition to interconnected products, have 8 timers 
TIM6, TIM7: basic timer 
TIM2/3/4/5: general timer 
TIM1, TIM8: advanced timer

The difference between the three timers: 
Write the picture description here

Basic timer: 
The basic timers TIM6 and TIM7 each contain a 16-bit auto-load counter driven by their own programmable prescaler. They can be used as a general-purpose timer to provide a time base, in particular, they can provide a clock for a digital-to-analog converter (DAC). In fact, they are directly connected to the DAC inside the chip and directly drive the DAC through the trigger output. The two timers are independent of each other and do not share any resources.

Basic timer block diagram: 
Write the picture description here

1. The timer clock source 
TIM6 TIM7 is mounted on APB1 and is controlled by the pre-scaling coefficient. 1: 36M 2: 72M

2. Counter clock 
After the timer clock passes through the PSC prescaler, that is, CK_CNT, it is used to drive the counter to count. The PSC prescaler is a 16-bit register, so the screen division coefficient is 1-65536

3. Counter 
TIM6/7 is a counter that can only count up

4. Automatic Load Register 
The automatic load register is a 26-bit register that contains the overflow value of the counter.

Calculation of timing time 
The timer clock is: CK_CLK 
pre-division value: PSC 
automatic load register value: ARR number 
of times entering interruption: time 
t=time*(ARR+1)*(PSC+1)/(CK_CLK)


Keywords:STM32 Reference address:STM32 timer learning---basic timer

Previous article:STM32F103 series RTC crystal oscillator problem solving record
Next article:STM32 system clock setting, using external active crystal oscillator related configuration issues

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号