PWM with timer2 in P16F877

david_mora

New Member
hi people, i have a question, i'm trying to covert a simple analog signal into a pwm signal using a PIC 16F877. It means that if the voltage in CH5 (RE0) is 5V, the duty cycle is 100% but if the voltage is 0V the duty cycle is 0%. I used the PWM module but the quentios is this: do i have to disable the CCP1 to chenge the duty cycle (CCPR1L)??
 

No, all you need to do is write to the register, it updates when it next outputs the pulse.
 
i think you should use the ic sg3525a , this ic is capabel of working with 8 to 35 v andcan provide you the continuous pwm output.

sunil patel
contact_sunilpatel@yahoo.com
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…