Well, the test has established that high resistance is the factor preventing the full range of PWM duty cycle. I'm surprised that is the case, since an analogue input on a MCU will usually accept a source impedance up to about 10k before significant loss of A/D conversion accuracy, if I remember correctly. I'd be suspicious that the input port has sustained damage?I started with a 5K resistor and it wouldn't even start producing a PWM signal. I went down to a 330 ohm resistor and that brought a 100 percent duty cycle down to a 10 percent. Even a 100 ohm massively dropped the duty cycle.
I'm not fluent in C or PIC, so can't comment on the uploaded code.



