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 read analog 9 volts via analog pins?

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



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

Can I read analog 9 volts via analog pins?
PostPosted: Fri Feb 26, 2010 3:20 pm     Reply with quote

Can I read analog 9 volts via analog pins? Should I set Vref high and low values to 9 and 0, respectively ? Also I wonder, if I give 9 volts to an analog pin for adc, would I damage or burn pic ? I use pic 16f876.
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Feb 26, 2010 3:57 pm     Reply with quote

Quote:
Also I wonder, if I give 9 volts to an analog pin for adc, would I damage or burn pic ?

Exactly! If you don't need to to know more about the difference between damage and burn, just let it be.
Use a voltage divider to keep the specified PIC voltage rating. You may want to consult the datasheet for details.
memoally



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

PostPosted: Fri Feb 26, 2010 4:08 pm     Reply with quote

But I dont want to lose power on voltage divider, because I use a battery and power lost (the power across pot or resistor, whatever) shortens my battery's life. I want to measure a battery of 9 volts. How can I do that?
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 26, 2010 4:14 pm     Reply with quote

Now that you have told us what your purpose is, we can give you some
links to articles in the forum archives for measuring battery voltage:

How to design low battery indicator (3 pages):
http://www.ccsinfo.com/forum/viewtopic.php?t=24560

Checking a battery voltage with A/D:
http://www.ccsinfo.com/forum/viewtopic.php?t=24842

Newbee - battery level:
http://www.ccsinfo.com/forum/viewtopic.php?t=23186

If you have any questions, post them here in this thread.
(Not in the threads above).
memoally



Joined: 25 Jan 2010
Posts: 35

View user's profile Send private message MSN Messenger

PostPosted: Fri Feb 26, 2010 4:45 pm     Reply with quote

Thank you pcm programmer, if I can't understand any point, I will ask it from here.
_________________
compiler version: 4.105
pic: 16f876
clock frequency: 4MHz
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