Skip to main content
Lchal.1
Associate III
Aug 27, 2020 12:04 PM UTC
Solved

hello, i need to set my counter mode as edge align or center align mode in my PWM . But do i need to add any line of code in my program or just i can set in my counter mode settings. can anyone let me help what i need to add in my code so that i ge

my PWM wave as center align mode.

Thank you

This topic has been closed for replies.
TDK
TDKBest answer
Aug 27, 2020 1:17 PM UTC

Counting mode is controlled by the TIMx_CR1_CMS bits. Timer must be disabled before you can change them.

If you're using CubeMX, it'll generate the initialization code for you. Or you can change them yourself.

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Aug 27, 2020 1:17 PM UTC

Counting mode is controlled by the TIMx_CR1_CMS bits. Timer must be disabled before you can change them.

If you're using CubeMX, it'll generate the initialization code for you. Or you can change them yourself.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Lchal.1
Lchal.1Author
Associate III
Aug 28, 2020 3:41 AM UTC

Thank you