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

Can i connect a pot directly without ADC to 16F877a to read?

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



Joined: 17 Apr 2014
Posts: 29
Location: chennai

View user's profile Send private message

Can i connect a pot directly without ADC to 16F877a to read?
PostPosted: Sat May 03, 2014 2:09 am     Reply with quote

Can i connect a potentiometer directly without ADC to 16F877a to read the values directly ? Pls reply soon. waiting for it. I want to connect the pot as Analog Input.
_________________
uma
Application Engineer,
ETPL
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat May 03, 2014 3:53 am     Reply with quote

The '877A PIC has a built in ADC.

Read the data sheet to find out which pins you can use as analogue inputs.

Mike
temtronic



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

View user's profile Send private message

PostPosted: Sat May 03, 2014 5:15 am     Reply with quote

As Mike says, The 877 does have several inputs to the ADC however if none are available there is a method of using a digital I/O pin to read analoque voltages. You'll have to probably use Google to locate the method. I can't show you my CCS C code for it as that was 14 years ago when I did it!

hth
jay
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat May 03, 2014 2:24 pm     Reply with quote

as a rule of thumb:

the resistance of the pot - end to end must be NO greater than Twice the MINIMUM specified source impedance for accurate ADC reading.

so for a given PIC with a 5k ohm source minimum a 10k pot is as HIGH in value as you dare go.
assuming one end of pot is at Vcc and the other at ground.
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Sat May 03, 2014 2:33 pm     Reply with quote

You can also cheat another way.
This chip has a programmable Vref, feeding the comparator. Only a handful of lines of code to simulate a 16 level ADC with this.
uma



Joined: 17 Apr 2014
Posts: 29
Location: chennai

View user's profile Send private message

PostPosted: Tue May 06, 2014 12:30 am     Reply with quote

thanks for your responses guys,i was busy a little with other project,hence took a gap in this project.I will come back again with my queries after creating and testing my model.
_________________
uma
Application Engineer,
ETPL
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