From the clock tree we can know
(1) The clock source of advanced timer timer1, timer8 and general timer timer9, timer10, timer11 is APB2 bus.
(2) The clock source of general timer timer2~timer5, general timer timer12~timer14 and basic timer timer6, timer7 is APB1 bus.
From the internal clock tree of STM32F4, we can see that
(1) When the division number of APB1 and APB2 is 1, the clock of TIM1, TIM8~TIM11 is the clock of APB2, and the clock of TIM2~TIM7, TIM12~TIM14 is the clock of APB1;
(2) If the division ratio of APB1 and APB2 is not 1, the clocks of TIM1, TIM8 to TIM11 are twice the clock of APB2, and the clocks of TIM2 to TIM7, TIM12 to TIM14 are twice the clock of APB1.
According to the clock analysis, click to open the link , we can see
Because the APB1 bus clock is initialized to 42M divided by 4 and the APB2 bus clock is initialized to 84M divided by 2 in the SystemInit function, the clocks of TIM1, TIM8~TIM11 are twice the APB2 clock, i.e. 168M, and the clocks of TIM2~TIM7, TIM12~TIM14 are twice the APB1 clock, i.e. 84M.
Knowing the clock source frequency of the timer, it is very convenient to use the timer for delay. We just need to set the appropriate frequency division coefficient. Here is the formula for delay using interrupts: (from the Atomic STM32F4 Development Guide)
Tout = ((arr+1)*(psc+1))/Tclk;
In the formula, psc is the frequency division coefficient, arr is the count value, and when this count is reached, an overflow interrupt will occur. Tclk is the clock source frequency I analyzed above.
Previous article:Share the problem about the stm32f407 timer clock frequency
Next article:How to set the system clock for STM32F4
Recommended ReadingLatest update time:2024-11-16 15:38
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【Repost】Thirty Practical Experiences in Switching Power Supply Design (Part 1)
- Good book recommendation! A brief review of Luo's "Basics of Power Supply Design"
- Please give me some advice, is this an amplifier impedance issue?
- Will the wave of Internet layoffs in 2019 have an impact on salary negotiations when changing jobs?
- Which pins should be connected when adding the Bluetooth module to the IMX6?
- [Qinheng Trial] Three CH549 uses pwm to adjust the brightness of the lamp
- About C language conditional compilation
- 【RT-Thread Reading Notes】Reflections on RT-Thread Chapter 9
- 100% gift for a limited time: Download and share Keysight millimeter wave radar data to win a gift
- About GUI_Init stuck when emwin is ported to stm32f2