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

How to use Vref +- with ADC

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



Joined: 23 Sep 2003
Posts: 12
Location: South KOREA

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger

How to use Vref +- with ADC
PostPosted: Fri Feb 18, 2005 9:19 am     Reply with quote

Dear Master

I use 16F874 It's have Vref +/-
So... I'll use it Vref+ is 3.9V Vref- is 0.8V
than How to control in CCS-C

and If I use 2Chnnal
1 Ch is 0.8 - 3.9V Out put sensor
2 Ch is 0 - 5 V Output sensor

AD0 = Ch1
AD1 = Ch2
AD2 = none
AD3 = Vref+ 3.9V
AD4 = Vref- 0.8V

than How to codeing?
_________________
Hello~?

This is South KOREA
My name is Sanghyouk Kim But Call me Nick
Sorry I'm poor English
libor



Joined: 14 Dec 2004
Posts: 288
Location: Hungary

View user's profile Send private message

PostPosted: Fri Feb 18, 2005 10:39 am     Reply with quote

You can use the SETUP_ADC_PORTS(AN0_AN1_VREF_VREF) command to set up two analog input channels, and have two VREFs supplied from pins AD3 and AD4 when measuring Ch1.
To use Ch 2 sensor with a full range of 0 - 5V you have to switch off the outside reference sources and use VSS VDD (0 - 5 V) as reference when measuring Ch2, You can do it with SETUP_ADC_PORTS(AN0_AN1_AN3) command before switching to Ch2.
However if your Ch2 sensor is in the VREF range, you can also leave the references permanently on for both channels. (you can also decide it in your code, and switch to VREFs only if the sensor is out of VREF limits. (be careful, the input voltage cannot outside the Vref limits more than 0.3 V, look it up in the datasheet)

Be sure to let enough time between switching channels (and VREF mode) for the ADC to settle.
Do you really need the increased resolution on Ch1 so you need the VREFs ?
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