The output configuration of the PWM of the STM32 TIM2 is invalid

Publisher:WhisperingSongLatest update time:2018-12-28 Source: eefocusKeywords:STM32  TIM2  PWM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Today's test found that the PWM output of TIM2 is invalid. It turns out that


The clock of TIM2 is wrong: RCC_APB2PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); should be changed to


RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);


The clock is written incorrectly, resulting in invalid configuration and all register values ​​are zero.


Keywords:STM32  TIM2  PWM Reference address:The output configuration of the PWM of the STM32 TIM2 is invalid

Previous article:Key points of STM32 CAN
Next article:STM32 uses PWM + DMA to drive WS2812

Recommended ReadingLatest update time:2024-11-16 13:33

Understanding of STM32 NVIC register direction
The interrupt vector nesting controller is used to manage all interrupts and events, including interrupt enable and disable, and interrupt priority. This belongs to the kernel, so ST's reference manual has little description of it, but it is very important. To understand it, you need to read ARM's "Cortex™-M4 Devices
[Microcontroller]
Understanding of STM32 NVIC register direction
stm32 program downloaded successfully but does not run
Debugging the stm32 program, the following problems were found:        When writing a program for STM32, when there is no SD card part in the program, the program can be downloaded and run normally. When the SD card plus file system is running in the program, the program can be downloaded normally but cannot run norma
[Microcontroller]
stm32 program downloaded successfully but does not run
STM32 serial port flag and it flag
Today I used the serial port of stm32 and configured it to receive data. You can imagine what the result was, it was completely useless!  Later, I slowly discovered the problem and made the following notes: ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT); USART_IT parameters: #define USART_IT_PE
[Microcontroller]
STM32 Getting Started: Lighting
Operation on pins: E.g. light up the LED light: 1. First, you need to know the pins corresponding to the LED lights, find its module block diagram and clock tree in the datasheet of the corresponding chip, find the parent clock and turn it on. Then initialize it with the structure, and configure the corresponding
[Microcontroller]
Porting STM32 firmware library to IAR
As an embedded software engineer, you should have good habits and build projects with clear levels. 1. Create a folder to store the project and name it GPIO   2. Open the GPIO folder, create a subfolder project (for storing project-related files), and then create a readme.txt (for the description of the proje
[Microcontroller]
Porting STM32 firmware library to IAR
Some common problems in stm32 development using MDK
1. Solution: Keil reports an error: invalid redeclaration of type name "s32" Answer: Generally, you need to add several fixed header file paths in Include Paths in the Target Options C/C++ tab. ..CMSISCM3CoreSupport ..CMSISCM3DeviceSupportSTSTM32F10x ..STM32F10x_StdPeriph_Driverinc ..userinc   It is a header fil
[Microcontroller]
Transient Modeling and Analysis of Single-Phase UPF Boost PWM Converter
Figure 1 shows the block diagram of a single-phase UPF Boost PWM converter, which is a dual-loop control system with a Boost converter as the main circuit. The outer loop is a voltage loop, which adjusts the average value of the output voltage to make it close to the voltage set value Ur. The inner loop is a current
[Power Management]
Transient Modeling and Analysis of Single-Phase UPF Boost PWM Converter
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号