in this code i want to increase the duty ratio until the input volts at RA1 is equal to the Vref, after while loop is true to light the led at portb.5. the problem here is the output is not increase and the duty ratio are not changing to make the output to vary, i need help here to make my code to do as i want
Code:TRISA=255 TRISB=0 CMCON=%00000101 compOut VAR CMCON.7 VRCON=0 pauseus 10 duty var byte duty=0 while (compout=0) pwm 7,duty,1 duty=duty+1 wend portb.5=1 pause 100
this is my circuit
Bookmarks