2017-09-11 05:54 AM
Hello all,
My question is regarding duty cycle vary according to ADC value I am using STM32F030R8T6 Controller TIM3 is used to generate 20khz signal Prescaler value is 47 and count period is 50 I want to vary duty cycle of 20khz signal according to ADC value(0-3.3v) but I am unable to do this so please guide me
another question is if I want to reload any value of PWM how it can do
2017-09-11 07:05 AM
Prescaler of 48-1 (47) gives you 1 MHz from 48 MHz
Period of 50-1 (49) gives you 20 KHz from 1 MHz
A Pulse width = 50/2 (25) gives you 50/50 duty, pulse of 50/5 (10) gives you 20/80 duty, 50=100%, 0=0%