Hi there,
I have a 40kHz sinwave, 70 millivolts (peak-to-peak) 200µs pulse signal I want to analyse in a PIC16F88; I'm making an ultrasonic range finder. I want to use one comparator as 'comparator' and the second one as an 'op amp'.
Firstly, I'm confused because of datasheets statements:These two statments made me think for hours that the voltage reference module would ONLY work in the comparator mode 010. I use the Two Independent Comparators CM2:CM0 = 100 and still can make the voltage reference work. So what's the exact meaning of these statements?13.3.2 INTERNAL REFERENCE SIGNAL
... The internal reference signal is used when comparators are in mode CM<2:0> = 010
14.0 COMPARATOR VOLTAGE REFERENCE MODULE
The comparator voltage reference generator is a 16-tap resistor ladder network that provides a fixed voltage reference when the comparators are in mode ‘010’...
Anyway, I have set now CVRCON = %11100001 and get a reference voltage of 200mV. This is far too high for my incomming signal. I need to amplify the incomming signal.
I'm reading and re-reading the Tips'nTricks (see attachment) and still don't understand how I can use a comparator as an Op Amp
I know how to connect a conventional op amp but how do I do it "inside" the PIC? Any example?
Bookmarks