Changing DC on a PWM output with HAL
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-18 5:13 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-18 9:16 PM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-19 1:53 PM
Posted on April 19, 2015 at 22:53
Ok! thank!!!
BTW, it should call HAL_TIM_SET_PWM_DC...