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

PIC16F628A Comparator mode

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



Joined: 23 Mar 2012
Posts: 8

View user's profile Send private message

PIC16F628A Comparator mode
PostPosted: Sat Apr 28, 2012 11:53 am     Reply with quote

Hello,
I want to use C2 comparator of PIC16F628A. Please could anyone to explain me the two below commands. Pin RA2 has a stable voltage at 2,5V (Vref) and pin RA1 is my analog input. The pins RA0 and RA3 I used as digital inputs. What means VR? Thanks.
Code:

setup_comparator(A0_VR_A1_VR);

Picture link :
http://i46.tinypic.com/5oa2qb.png

dyeatman



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

View user's profile Send private message

PostPosted: Sat Apr 28, 2012 12:47 pm     Reply with quote

VR means voltage reference. Section 11 of the datasheet gives a full
description of the internal Voltage Reference module. See 10.3.2 and figures
11-1 and 11-2. Also note in 11.2 that internal VRef is affected by changes in
VDD which affects accuracy.
_________________
Google and Forum Search are some of your best tools!!!!
2-Chri



Joined: 23 Mar 2012
Posts: 8

View user's profile Send private message

PostPosted: Sun Apr 29, 2012 10:48 am     Reply with quote

I write the below command and works perfect.
Code:

setup_comparator(NC_NC_A1_A2); // Turn on Comparator C2.

Comparator C1 is not used.

Thanks for your answer.
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