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

Comparator setup

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



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

Comparator setup
PostPosted: Mon May 08, 2006 9:55 am     Reply with quote

Hi,

this is part of 16F628A.h file about comparator setup.


Code:
// Comparator Variables: C1OUT, C2OUT
// Constants used in setup_comparator() are:
#define A0_A3_A1_A2  0xfff04
#define A0_A2_A1_A2  0x7ff03
#define NC_NC_A1_A2  0x6ff05
#define NC_NC_NC_NC  0x0ff07
#define A0_VR_A1_VR  0x3ff02
#define A3_VR_A2_VR  0xcff0A
#define A0_A2_A1_A2_OUT_ON_A3_A4 0x7e706
#define A3_A2_A1_A2  0xeff09

#bit C1OUT = 0x1f.6
#bit C2OUT = 0x1f.7


I need to define A3_VR_NC_NC that isn't among possibilities.

would you please help me?

I have a led on A2 pin ....how does my PIC will behave in case i use A3_VR_A2_VR setup for comparator??


thanks
Ttelmah
Guest







PostPosted: Mon May 08, 2006 10:53 am     Reply with quote

Look at the data sheet for the chip. There are eight possible configuration modes for the comparator, which are the eight patterns available in the CCS include file.
However remember that if you set a pin usng TRIS, so that it is not in the mode that the peripheral requires, you can then still use it for other things.

Best Wishes
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