Skip to main content
GH M
Associate
Aug 8, 2019 6:56 AM UTC
Question

Need to know how to start PWM with slow increase in duty cycle(SOFT START LIKE RAMP FUCNTION) slowy increase from 0% to some set duty cycle

code is attached below

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
Aug 8, 2019 7:04 AM UTC

You do this by changing the PWM duty cycle by changing the content of respective TIMx_CCRx register.

JW

GH M
GH MAuthor
Associate
Aug 8, 2019 9:20 AM UTC

it should change on its own..

waclawek.jan
Super User
Aug 8, 2019 10:36 AM UTC

Then use DMA, triggered from the timer's Update event, to reload TIMx_CRRx from a precalculated table upon each cycle.

JW