Comparators
Posted: Sun Sep 11, 2011 7:52 pm
Hello,
I want two comparators with internal reference voltage for e.g. PIC16F877A
http://ww1.microchip.com/downloads/en/D ... 39582b.pdf
The CVRON Control register gives me the wanted reference voltage (see chapter 13) and the comparator register CMCON (CIS=CM3) tells me which 2 inputs I can use (=0 for RA3 and RA2 or =1 RA0 and RA1). The output of the comparators can be read from CMCON bit 6 and 7 (CM6 and CM7).
Now I want to use these outputs in the software only and preventing them to come on the outputs RA4 and RA5.
Now my question: How do I prevent that the the comparator-outputs comes on RA4 and RA5? Just by setting trisa?
But if I set RA4 and RA5 as output, can I use RA4 and RA5 as ouptput for other reasaons? Or will RA4 and RA5 as output always comparator outputs?
With kind regards
Jan Lichtenbelt
I want two comparators with internal reference voltage for e.g. PIC16F877A
http://ww1.microchip.com/downloads/en/D ... 39582b.pdf
The CVRON Control register gives me the wanted reference voltage (see chapter 13) and the comparator register CMCON (CIS=CM3) tells me which 2 inputs I can use (=0 for RA3 and RA2 or =1 RA0 and RA1). The output of the comparators can be read from CMCON bit 6 and 7 (CM6 and CM7).
Now I want to use these outputs in the software only and preventing them to come on the outputs RA4 and RA5.
Now my question: How do I prevent that the the comparator-outputs comes on RA4 and RA5? Just by setting trisa?
But if I set RA4 and RA5 as output, can I use RA4 and RA5 as ouptput for other reasaons? Or will RA4 and RA5 as output always comparator outputs?
With kind regards
Jan Lichtenbelt