cancel
Showing results for 
Search instead for 
Did you mean: 

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 get

Lchal.1
Associate II

my PWM wave as center align mode.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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
Associate II

Thank you