Skip to main content
GH M
Associate
August 8, 2019
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

  • August 8, 2019
  • 2 replies
  • 1798 views

code is attached below

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
August 8, 2019

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

JW

GH M
GH MAuthor
Associate
August 8, 2019

it should change on its own..

waclawek.jan
Super User
August 8, 2019

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

JW