TimerPWM
|
Readme
frequency = f / (prescale+1) / period The d0 d1 duty cycles of the PWM outputs will be
d0 = duty0 / period In this first example, f is 32768 Hz, prescale is 0,duty0 is 250, duty1 is 750 and period is 1000. The first figure shows this creates two 32.768Hz PWM outputs with 25% duty cycle on PA12 and 75% duty cycle on PA13. Notice the waves are synchronized, so the rising edges occur at the same time.
In this second example, f is 48 MHz, prescale is 47,duty0 is 2500, duty1 is 7500 and period is 10000. The first figure shows this creates two 10 kHz PWM outputs with 25% duty cycle on PA12 and 75% duty cycle on PA13.
Derived from Texas Instrument code
|
|
Hardware Required
|