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 support@ccsinfo.com

Comparator setup for Microchip 16F684

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



Joined: 29 Aug 2007
Posts: 14

View user's profile Send private message

Comparator setup for Microchip 16F684
PostPosted: Wed Aug 29, 2007 5:19 pm     Reply with quote

Hello,

What is the correct hex number to set up the comparators on the Microchip 16F684 using A1 and A0 in the off state and using C1 - C0 with the output C2OUT? The mode from the data sheet is:

CM<2:0> = 101.

The code generated from the supplied 16F684.h file does not have this option. When I use the PIC Project Wizard, the code generated defaults to:
setup_comparator(NC_NC).

Thanks!

P.S. Also, if anyone can supply what the different nibbles in the 0xnnnnn hex number represent in the setup_comparator() function, that would be even better because the 16F684.h file only seems to have a few of the possible modes.
dyeatman



Joined: 06 Sep 2003
Posts: 1923
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Aug 29, 2007 5:52 pm     Reply with quote

What version are you using?

Version 4.053 works with no problems.

setup_comparator(NC_NC_C1_C0);

In the header file:
#define NC_NC_C1_C0 0x10FF05
elellilrah



Joined: 29 Aug 2007
Posts: 14

View user's profile Send private message

PostPosted: Wed Aug 29, 2007 6:00 pm     Reply with quote

I am using 3.241 and those files don't have that information in there. I will try your hex code in there and see if it works.

Thanks!
elellilrah



Joined: 29 Aug 2007
Posts: 14

View user's profile Send private message

PostPosted: Thu Aug 30, 2007 1:18 pm     Reply with quote

The op-code you provided worked perfectly, thank you.

I need to find a more recent copy of the full 16F684.h file as it must have several changes in it.
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