In the past, when organizing the code, all peripherals, such as ports, timers, serial ports, etc., were initialized when the system clock was initialized.
Today I had a sudden idea to put the initialization of each peripheral into the module of each peripheral, so that unused peripherals do not need to be given clocks, thus reducing energy consumption.
Just like that, the problem arises: there is no waveform output during PWM output.
I repeatedly checked and compared the timer's function module configuration, output IO settings, RCC configuration, etc., but I still couldn't find the cause.
When I was about to give up, I scanned the code intermittently, and suddenly I saw that the clock for the output IO was not configured before setting the output IO code, but was configured afterwards.
Is this the problem? I tried it immediately and it turned out to be the case.
This is a wake-up call!! :)
Therefore, you must configure the IO clock before configuring the output IO, remember this!
Previous article:stm32 uses PWM wave interrupt to accurately control the number of waves
Next article:Use STM32F103 to experiment and summarize PWM related knowledge
- 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
- What benefits can 5G bring? Welcome to leave a message and give points for good posts
- GD32L233C-START evaluates the implementation of serial port USART0 printf redirection
- DSP has a problem with printf function running away in CCS environment
- USB transformation of ESP32-S2-Saola-1
- Is there any delay when directly connecting FPGA I/O pins?
- Eat mushrooms and see villains! It's the time of the year again when Yunnan people poison themselves
- Getting Started with Modelsim
- Crosstalk Elimination Technology in Altium Designer
- Date in spring + small flowers blooming in the spring bushes
- [Sipeed LicheeRV 86 Panel Review] Debian Python + Serial Communication