cancel
Showing results for 
Search instead for 
Did you mean: 

Changing DC on a PWM output with HAL

leogarberoglio
Associate III
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!
2 REPLIES 2
noobee
Associate II
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
Posted on April 19, 2015 at 22:53

Ok! thank!!!

BTW, it should call HAL_TIM_SET_PWM_DC...