STM32 PWM mode phase and settings

Publisher:RadiantSerenityLatest update time:2015-06-12 Source: 51heiKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
For pwm, the phase and PWM mode are related to CCER->CCxP. The corresponding relationship is as follows:
CCER->CCxP = 0; In PWM mode 1, TIMx->CRRx= 0; is low level. TIMx->CRRx = TIMx->ARR; is high level, the larger TIMx->CRRx is, the larger the positive duty cycle is.

CCER->CCxP = 1; In PWM mode 1, TIMx->CRRx= 0; is high level. TIMx->CRRx >= TIMx->ARR; is low level, the larger TIMx->CRRx is, the smaller the positive duty cycle is.

CCER->CCxP = 0; In PWM mode 2, TIMx->CRRx= 0; is high level. TIMx->CRRx = TIMx->ARR; is low level, the larger TIMx->CRRx is, the smaller the positive duty cycle is.

CCER->CCxP = 1; In PWM mode 2, TIMx->CRRx = 0; is low level. TIMx->CRRx >= TIMx->ARR; is high level. The larger TIMx->CRRx is, the larger the positive duty cycle is. 
Keywords:STM32 Reference address:STM32 PWM mode phase and settings

Previous article:stm32 advanced timer relearning
Next article:Transfer the usage code of two stm32 timers

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

STM32 USB CDC driver issue
question: The STM32 USB CDC project is generated using STM32Cube. After compiling and downloading, the following problems are found when the USB is plugged in: A yellow exclamation mark is displayed in the device manager, indicating that the driver is abnormal. reason: Since the SMT32 USB code uses standard
[Microcontroller]
STM32 USB CDC driver issue
[STM32] Overview of external interrupts, registers, library functions (EXTI general steps)
STM32F1xx official information: "STM32 Chinese Reference Manual V10" - Chapter 9 Interrupts and Events   External Interrupt Overview External interrupt (EXTI) is different from the external interrupt of CM3 core described in NVIC interrupt priority management (interrupt vector table). Specifically refers to the
[Microcontroller]
[STM32] Overview of external interrupts, registers, library functions (EXTI general steps)
Summary of problems encountered in debugging STM32 time
When adding a new time in the program, the register cannot be written during initialization. The reason is that the relevant initialization is not performed and a register is not enabled.   The procedure is as follows: void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) {   //GPIO_InitTypeDef GPIO_InitStruct;     
[Microcontroller]
stm32 SWD mode download
We usually use Jlink downloader, but one disadvantage of this downloader is that it uses Jtag 20PIN interface. Too many PINs will make some small PCB boards crowded and increase the difficulty of wiring. However, using SWD interface to download and debug only requires 4 PINs: GND, RST, SWDIO, SWDCLK, and the download
[Microcontroller]
stm32 SWD mode download
STM32-Serial Port Program
    When learning about various hardware, the serial port is an essential and first peripheral to learn, because with the serial port, you can interact with the hardware in a simple way, and it is also easier to verify the correctness of the written program.     STM32 has multiple USARTs and supports multiple modes of
[Microcontroller]
STM32 learning startup code comments
;Reset_Handler subroutine starts  Reset_Handler PROC ; Output subroutine Reset_Handler to external file  EXPORT Reset_Handler ; Import the __main function from an external file  IMPORT __main ;Introduce SystemInit function from external file  IMPORT SystemInit ; Load the SystemInit function call address into
[Microcontroller]
How to use Printf function in Keil IDE under STM32
Please check "Target"- "Code Generation" in the MDK (keil) project properties. 选”Use MicroLIB   The premise is that you have a complete Keil project. For example, when debugging ADC, the serial port is often used. Here I will teach you how to use it. Using Printf function The words in red are the key points! ! ! ! To
[Microcontroller]
Learn STM32 (2) - IO-AFIO (multiplexing function IO and debugging configuration)
I'm learning STM32 recently. In an article about serial communication on BZ, there is a piece of code: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO,ENABLE); I wrote it with reference to the development guide. I never understood the meaning of GPIOD or "RCC_APB2Periph_AFIO". After searching onli
[Microcontroller]
Learn STM32 (2) - IO-AFIO (multiplexing function IO and debugging configuration)
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号