Amplitude and PWM

Discussion in 'General Electronics Chat' started by olvine, Mar 14, 2014.

  1. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    Hey all,

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

    maximum amplitude could be 5V.
     
  2. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,134
    268
    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.
     
  3. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    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 ?
     
Loading...