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

A/D using a Vrefenece > V supply?

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



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

A/D using a Vrefenece > V supply?
PostPosted: Thu Aug 10, 2006 11:30 pm     Reply with quote

Hi

I have been doing A/D using Vsupply to the PIC (5V) as the reference. (I assume this is the default since I did not have to specify it anywhere).

I would like to migrate to the LF PIC and use 3V supply.
However my sensor has to operate at 5V. Thus as I understand it the A/D has to be at 5V as well.
I was wondering if I could use the Vreference at 5V while Vsupply to the PIC is 3V?

If yes, could someone please tell me how I can do this exactly?

Thank you
a.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Aug 11, 2006 2:42 am     Reply with quote

You cannot connect this directly to the PIC. It could result in the destruction of the PIC or at least put it in latchup mode.

Instead leave you PIC setup with VDD as the reference (now 3.3 volts) and scale your inputs. If you were using an opamp then you could change the gain. For example, if your opamp previoulsy had a gain of 100 you will now need a gain of 100/5*3.3=66 to give you the same scale factor. This means your PIC program does not need to be modified.

If you do not have opamps on the front end then you could use voltage divides to give similar scaling. You need to keep the resistance value low in order not to impact the A/D reading. If this is not poosible you can use higher values of resistance (despite what it says in the data sheet) providing you incease the time between selecting a channel and taking a reading.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Fri Aug 11, 2006 2:49 am     Reply with quote

Hi Asmallri

Thank you for your suggestions.
I will use high values of R V divider (to limit current drain), and then an op amp follower. This should work, right?

Regards
a.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Aug 11, 2006 3:17 am     Reply with quote

Yes that will work.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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