Amplitude and PWM

Thread Starter

olvine

Joined Mar 10, 2014
99
Hey all,

How can I measure amplitude of a sine wave and generate PWM accordingly using controller PIC16F887 ?

maximum amplitude could be 5V.
 

Sensacell

Joined Jun 19, 2012
3,448
Sample the input signal with the ADC at a rate higher than 2 X the maximum input frequency, then feed the result to the Capture-Compare-PWM system.

You should include an analog low-pass filter on the front end to prevent "aliasing"- google the term.
 

Thread Starter

olvine

Joined Mar 10, 2014
99
okay. now lets say I have 3V amplitude and the frequency of PWM is 1000hz. what would be the duty cycle of PWM ??

Any mathematical relation ?
 
Top