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

Reading an analog voltage with a digital input

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



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Reading an analog voltage with a digital input
PostPosted: Thu Mar 22, 2007 9:25 am     Reply with quote

Hi,

How can I use a 16F648A mcu to read an analog voltage (0 to 5 V range) ?

The 16F648A does not have a ADC, but it has a comparator. Also mention what the accuracy of the result would be ???

thanks
arunb
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Thu Mar 22, 2007 11:02 am     Reply with quote

Using another port of the PIC as an output you can charge/discharge an RC element that is connected to the comparator's first input. The timepoint, the comparators triggers corresponds to the analog voltage on the second input of the comparator.
Accuracy: depends on how slow is your RC element, this also affects the 'sampling frequency'.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 23, 2007 12:26 pm     Reply with quote

Quote:

How can I use a 16F648A mcu to read an analog voltage (0 to 5 V range) ?
The 16F648A does not have a ADC , but it has a comparator.

This project may help:
http://web.archive.org/web/20060427170840/http://www.cappels.org/dproj/wfc/wfc.html
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Mar 25, 2007 8:57 am     Reply with quote

For slope
ww1.microchip.com/downloads/en/AppNotes/00863a.pdf

For delta
ww1.microchip.com/downloads/en/AppNotes/00700a.pdf
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