Maker Pro
Maker Pro

Using Vref as the input to comparator module

foTONICS

Sep 30, 2011
332
Joined
Sep 30, 2011
Messages
332
I have a PIC16f627a uController and I want to use the comparator module. One input to this comparator will be a signal from a sensor and the other input will be from the Vref pin on the uController itself.

The datasheet mentions that when using the Vref pin I should use a buffer (like a 741 set up for unity gain) since the Vref pin has limited drive capabilities. But since the comparator itself is an op amp do I still need the buffer, is the input impedance of the comparator high enough that I don't need it? Should I add it anyways so if something blows it's the buffer and not something internal to my chip?

Thanks in advance!
 

Arouse1973

Adam
Dec 18, 2013
5,177
Joined
Dec 18, 2013
Messages
5,177
Yes you can connect it straight in. It mentions this on the datasheet. Is this what you mean?

The output of the reference
generator may be connected to the RA2 pin if the
TRISA<2> bit is set and the VROE bit, VRCON<6>, is
set. Enabling the Voltage Reference module output onto
the RA2 pin with an input signal present will increase
current consumption. Connecting RA2 as a digital output
with VREF enabled will also increase current consumption

Thanks
Adam
 

foTONICS

Sep 30, 2011
332
Joined
Sep 30, 2011
Messages
332
ooooooooh I get it now. I was confusing myself. I was under the impression that the Vref output and the Vin- of the comparator were different pins. Selecting the appropriate register bits will make the connection internal right? I just have to make sure I don't use that pin for anything or else it could cause increased current consumption correct?

Thank you
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
The internal reference can be connected to the comparator inputs internally without any I/O pins involved. Just set the mode bits in CMCOM to 010.
10.3.2 INTERNAL REFERENCE SIGNAL
The Comparator module also allows the selection of an
internally generated voltage reference for the
comparators. Section 11.0 “Voltage Reference
Module”
, contains a detailed description of the Voltage
Reference module that provides this signal. The
internal reference signal is used when the comparators
are in mode CM<2:0> = 010 (Figure 10-1). In this
mode, the internal voltage reference is applied to the
VIN+ pin of both comparators.
Also, see figure 10.1 which shows all the configurations.


Bob
 
Top