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

How to use comparator on PIC18F4520

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



Joined: 10 Dec 2009
Posts: 18

View user's profile Send private message

How to use comparator on PIC18F4520
PostPosted: Wed Apr 21, 2010 2:32 am     Reply with quote

Hi,

I would like to, if it is possible, to use comparator on PIC18F4520 to compare Voltage on some input port with Value I defined in source code.

Any help would be grateful.

Thanks

Djole
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 21, 2010 1:15 pm     Reply with quote

You can use this program as an example:
http://www.ccsinfo.com/forum/viewtopic.php?t=22955&start=1
This program has a 5K trimpot on pin A0. By turning the trimpot, the
voltage on that pin can be changed in the 0v to 5v range.

Also, the pins in the #use rs232() statement need to be changed to pins
C6 and C7 for the 18F4520.
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