Joined: 11 Nov 2006 Posts: 181 Location: Birmingham, UK
12F675 Comparator
Posted: Fri Mar 15, 2019 1:55 pm
Hi, I am looking to use the comparator in the 12F675, but I have never used one in a PIC before. I can see the 2 inputs and I understand how comparators work, but nowhere can I find out how to read, programmatically the output state of the comparator. The example provided by CCS is of no use!
How does one read it please?
you test bit6(COUT) of the CMON register. It's 1st page of chapter 6..comparator. Now the output bit value depends upon the configuration you setup...kinda tricky so pen and paper and truthtable will help !
Jay
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Mar 15, 2019 3:24 pm
Here is a test program using the comparator for the 12F683.
This PIC is very similar to the 12F675. You should be able
to use the same program. It does everything you want to do:
http://www.ccsinfo.com/forum/viewtopic.php?t=42946&start=1
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum