Each capture/compare channel is built around a capture/compare register (including shadow registers), including the capture input section (digital filtering, multiplexing and prescaler), and the output section (comparator and output control).
Input: Digital filtering, multiplexing and prescaler
Output: Comparator and output control
In capture mode, the capture occurs on the shadow register, which is then copied to the preload register. In compare mode, the contents of the preload register are copied to the shadow register, which is then compared to the counter.
Configuration steps for output compare mode:
1. Select counter clock (internal, external, prescaler)
2. Write the corresponding data into the TIMx_ARR and TIMx_CCRx registers
3. If you want to generate an interrupt request and/or a DMA request, set the CCxIE bit and/or CCxDE bit.
4. Select the output mode, for example, toggle the OCx output pin when the counter CNT matches CCRx, preload CCRx and unused, turn on the OCx output and high level is valid, then you must set OCxM='011', OCxPE='0', CCxP='0' and CCxE='1'.
5. Set the CEN bit of the TIMx_CR1 register to start the counter
Previous article:Knowledge and configuration of STM32 general timer
Next article:Error[Pe020]: identifier appears when debugging STM32 with IAR
Recommended ReadingLatest update time:2024-11-16 12:55
- Popular Resources
- Popular amplifiers
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
- With the 5G wave, it’s time to upgrade RF filters!
- May Day holiday---spring cleaning
- Using efficient MicroSiP power modules to miniaturize ultrasonic smart probes
- Come quickly: Buy multimeters and development boards for 11.11 yuan, a Double 11 feast for new element11 users~
- Recommended RF front-end chips for mobile phones in the 5G era
- The Linux Foundation expects revenue to reach $177 million this year
- What does PAD mean in a circuit schematic?
- September 23 nexperia live broadcast review: Nexperia's efficient ESD solutions for connected car applications
- Knowledge of common op amp models
- These two methods make electric vehicles run farther in winter