Skip to main content
leogarberoglio
Associate III
April 19, 2015
Question

Changing DC on a PWM output with HAL

  • April 19, 2015
  • 2 replies
  • 745 views
Posted on April 19, 2015 at 02:13

Hello, I'm using a nucle 411 to test a RC servo driver. Si I configure 4 TIM3 channel to output PWM signal. Everithing is Ok, except that I can't finde a function to change PWM Duty Cycle.

Is there any?

BR!
    This topic has been closed for replies.

    2 replies

    noobee
    Associate II
    April 19, 2015
    Posted on April 19, 2015 at 06:16

    try

    __HAL_TIM_SET_COMPARE(htim, tim_channel, cnt);

    where cnt is the new pulse interval. cnt /htim->Init.Period would be theduty cycle.
    leogarberoglio
    Associate III
    April 19, 2015
    Posted on April 19, 2015 at 22:53

    Ok! thank!!!

    BTW, it should call HAL_TIM_SET_PWM_DC...