Hi Burt
let us overpass the first part of capturing a signal fed to rc.2 pin . I have build an oscillator using comparator1 hoping to use to measure capacitance. I found that I have to keep that oscillator working by making the code loop back over few instructions. If I try to do any thing else the oscillator stops (i.e if I make more instructions in the loop).How can I make that oscillator run independently?
You can use the chips OSC I don't no how fast you need it but with the timer to divide it and send out a pin could be done basically in the background or even PWM both should work. Full time
Hi Burt
Osc1 is connected to the xtal . What actually I want is using the comparator rc oscillator to measure the capacitance by using ccp1.When I make code to do that, oscillator stops ,you have to knock it all the time . I believe I can use an interrupt, to load the timer when signal is captured and go back after that to knock that oscillator , but I do not know how to make an interrupt when capture flag is 1. I do not want use an external oscillator. I attached the circuit.View attachment 62611
Thanks
Obaid