CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

12F675 Comparator

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

12F675 Comparator
PostPosted: Fri Mar 15, 2019 1:55 pm     Reply with quote

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?

Thanks

Brian
temtronic



Joined: 01 Jul 2010
Posts: 9249
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 15, 2019 2:09 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 15, 2019 3:24 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group