The easy way, is to keep this diode there and add a resistor from the cathode to the ground to discharge the capacitor.
Usually what i use, some higher resistor value, lower capacitor value, connect this to a OP-AMP input, OP-AMP output to the PIC. THat's it. There's no big chance to interfer to the PWM signal and the PWM circuit driver charge and discharge the Cap via the same resistor. BUT in some case, using some kind of OPTO-Isolator can also do the job.
OR skipping the kinda 'frequency to voltage conversion' and measure the duty but... depending of you.
This might be useful... well some parts 
EDIT: Warrier point you to some good idea too. I can't really comment them but those really make sense.
Last edited by mister_e; - 7th May 2005 at 00:36.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks