Skip to main content
İDAĞL.1
Visitor II
July 16, 2020
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?

  • July 16, 2020
  • 2 replies
  • 650 views

..

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
July 16, 2020

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 VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
July 16, 2020

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