Skip to main content
İDAĞL.1
Visitor II
Jul 16, 2020 2:06 PM UTC
Question

I cant change my duty cycle in LL TIM Library. I cant change my signal too. I want change my motor power. How can i do this?

..

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Jul 16, 2020 2:15 PM UTC

Should be a macro or wrapper,

Typically one just writes the register TIM2->CCR1 = (TIM2->ARR + 1) / 2; // 50/50 duty

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
TDK
Jul 16, 2020 7:22 PM UTC

LL_TIM_OC_SetCompareCH1 does this.

If you're modifying ARR or PSC, you may need to generate or wait for an update event for them to become active.

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