Hey all, How can I measure amplitude of a sine wave and generate PWM accordingly using controller PIC16F887 ? maximum amplitude could be 5V.