Hey Can you use the comparator on a pic as an analog amplifier then feed the result to the onboard ADC?
- posted
15 years ago
Hey Can you use the comparator on a pic as an analog amplifier then feed the result to the onboard ADC?
It's a comparator and not an op-amp, so I'd say no.
Some of the pic's have internal clocks. When used with the internal clock it appears that the amplifier used for the external xtal is available. I've toyed with the idea of using that as a gain stage.
does the comparator have an output that can be used in a physical feedback loop?
A comparitor *is* an Analog toDigital converter (1 bit...).
On a sunny day (Sun, 07 Dec 2008 02:35:16 -0800) it happened Robert Baer wrote in :
And a comparator is also an amplifier with high gain. The problem is: can you use feedback to use it as opamp. This requires the output and the inputs on a pin. On the PIC16F690 for example if you look in the data sheet (page 96), you see the comparator is connected to output pin C1OUT (pin 17) via an XOR gate. That makes the answer very simple: NO
Normally, a comparator is not compensated (this is done to allow for faster response in comparison with an op-amp). This means that even if you had access to the output, if you try to set up a feedback loop, you can experience stability problems.
On a sunny day (Sun, 7 Dec 2008 04:42:52 -0800 (PST)) it happened Darwin wrote in :
The XOR at the output makes me wonder if you could feedback from it, after all, a gate is _also_ a high gain amplifier. The other input to the xor will select between inverting and non-inverting. Maybe use some external compensation. But that would not be a reliable solution for a real design.
"Jan Panteltje" kirjoitti viestissä:ghgbt5$nb6$ snipped-for-privacy@news.datemas.de...
Actually, it works look here:
On a sunny day (Sun, 07 Dec 2008 15:16:41 GMT) it happened "E" wrote in :
mm seems to be oscillating? Do not use in life support systems...
I've seen PIC tech notes that do that.
So, yes, you can do it. You'll need some kind of compensation to prevent oscillation.
See 'tip 12' of the following document:
Regards, Bob Monsen
Yes, it appears to turn the comparator into some sort of an oscillating pulse width modulator. Seem like bizarre thing to do, however. Noisy indeed! The "C-OUT's" are definitely digital in nature so there is no way to put conventional analog feedback on them or turn the uncompensated comparator into an analog amplifier in the normal sense.
an
Oed!
There is no way to convert digital to analog?
Sure. But that was not OP's question. Nor does the topology of the IC involved allow proper summing properties to use the internal comparator for an amplifier.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.