I spent several days trying to get a timer to output a square wave. It worked fine at first, but then it stopped working. I was so frustrated...
After a long period of oscilloscope observation and exploration, I found that the functions of the registers in the ordinary comparison output mode and the PWM mode are different.
Comparison output mode
The characteristic of this mode is that the output cycle frequency of the four channels is the same. The frequency period is determined by the size of the preload register ARR. It is called Counter Period in Cubmx. The larger the value, the lower the output frequency.
But this mode has a feature that the initial phase of each channel can be determined by the CCRx of each channel.
PWM Mode
The frequency length of the waveform cycle is determined by ARR
The duration of the high level is determined by the CCRx of each channel.
The difference between the two modes is that the role of CCRx is different in different modes.
In output comparison mode, CCRx controls the initial phase.
In PWM mode, CCRx controls the high level counting cycle.
Previous article:STM32 serial port idle interrupt receives indefinite length data
Next article:The relationship between the frequency of the STM32 timer output square wave and PSC and CNT
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Application and precautions of Hall elements
- Which one is better to use, the Type-C interface or the MicroUSB interface for mobile phone data cables?
- Showing goods + development board and multimeter
- Why is the GaN device [G-level is negative voltage powered]
- Signal Integrity and Power Integrity Analysis (3rd Edition)
- Share the FAQ about STM32/8
- MCU Model Challenge 1: Guess the manufacturer and model based on the MCU's power pins.
- 【i.MX6ULL】Driver Development 9——Linux IO Model Analysis
- What is the selection method and calculation process of ESD tube? Which forum friend can write out the calculation steps?
- Five Experiences in RF Circuit Design