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

Vref+ and Vref-

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



Joined: 24 Apr 2010
Posts: 75
Location: Islamabad

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

Vref+ and Vref-
PostPosted: Fri Mar 25, 2011 6:28 am     Reply with quote

hi.. i am using PIC18F4550 and i want to use its A/D.. i want to know what is the minimum limit to define the reference voltages with controller PINs Vref- and Vref+ and how much it effects the accuracy..
thanks..
_________________
...
temtronic



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

View user's profile Send private message

PostPosted: Fri Mar 25, 2011 9:22 am     Reply with quote

I was going to say 'consult the datasheet' but I just did and unless I'm going blind I can't find anything about the ADC specs of input range, ref+, ref- ,etc. Not in the ADC section, or the DC characteristics section.

From memory, vref+ can be max at Vdd(+5), vref- as low as Vss(gnd) BUT the difference must be 2 volts. vref+=+4, vref-=+2 is OK, but vref+=+4 and vref-=+3 is not allowed.

Hopefully someone else who uses the 4550 daily will answer you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19347

View user's profile Send private message

PostPosted: Fri Mar 25, 2011 11:07 am     Reply with quote

Not quite. The difference must be 1.8v _or more_, when using a 3.3v supply and 3v or more when using a 5v supply. You can run with a 3v vref fine, or a 5v Vref with a 5v supply (this after all is what you have by default if you use the supply itself). It is in the data sheet. Table 28-28. For full 10bit accuracy, the Vref must be at least 3v.
Accuracy. Makes a big difference, depending on the supply. Remember if a supply regulator, claims '1% accuracy', this is with _static_ (resistive) loads. As soon as inductive, capacitive or switching loads are added the actual instantaneous levels on the supply rail, _will_ be varying significantly. I have achieved a repeatable 12bit accuracy off the standard 10bit ADC, by oversampling, using a 0.001% bandgap reference, good AC layout. Using the supply, you will be 'lucky' to get even 7bit....

Best Wishes
temtronic



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

View user's profile Send private message

PostPosted: Fri Mar 25, 2011 6:26 pm     Reply with quote

What gives...I just downloaded the 'latest' datasheet, xxx 2009, ds39632 rev E, and there's no tables !! This right from uCs website, arrghhh.

Where can I download a complete datasheet / I just got 6 of the 4550's to play with...tired of shoveling snow and rebuilding transmissions.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 25, 2011 8:11 pm     Reply with quote

I downloaded it:
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010300
It's got the tables right there:
Quote:
TABLE 28-28: A/D CONVERTER CHARACTERISTICS: PIC18F2455/2550/4455/4550 (INDUSTRIAL)
temtronic



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

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 5:12 am     Reply with quote

I gotta get me better bifocals.....I redownloaded it again , couldn't see it again,then slowly went page by page and finally saw it(page 404 of 438).I might have clicked too many times before and my slow PC skipped over it.
Either way, the information is there.
Bilal



Joined: 24 Apr 2010
Posts: 75
Location: Islamabad

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

PostPosted: Sat Mar 26, 2011 8:32 am     Reply with quote

what if i use deltaVref equals .6V????
is there any way so that i can use deltaVref .6V...
is there any other controller
please help
_________________
...
Ttelmah



Joined: 11 Mar 2010
Posts: 19347

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 9:06 am     Reply with quote

If delta Vref, is below 3v, you lose accuracy. You actually get as good resolution using a 3v Vref, and just using 1/5th the range, as using a 0.6v Vref.

The basic answer is to always amplify your signals up to the range matching your Vref. Given the relatively low source impedance requirements of the ADC, an amplifier stage is often needed anyway.
Obviously, there are higher accuracy ADC's, that will use a 0.6v vref range available, but you can start with them costing perhaps 5" the cost of a PIC, and rising to hundreds of times the cost of the PIC.

Best Wishes
Bilal



Joined: 24 Apr 2010
Posts: 75
Location: Islamabad

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

PostPosted: Sat Mar 26, 2011 11:29 am     Reply with quote

if i use deltaVref 0.6V.. and in my code i get 1000 sample A/D reading...
and add them all to get average.. Can it solve the problem of accuracy??
_________________
...
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 11:36 am     Reply with quote

Bilal wrote:
if i use deltaVref 0.6V.. and in my code i get 1000 sample A/D reading...
and add them all to get average.. Can it solve the problem of accuracy??


That would only help if the problem was random Gaussian noise. It will not help for non-linearities, which will be a big part of the A/D errors you get at extreme low voltages.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Bilal



Joined: 24 Apr 2010
Posts: 75
Location: Islamabad

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

PostPosted: Tue Mar 29, 2011 4:24 am     Reply with quote

Hi.. Please help me.. i want to sense temperature in a range 20degreeC to 40degreeC.. and i am using a low power op amps.. and those are work good on 2.5V.. and V+ is 5v and V- is ground..
i am using sensor PT100.. and i am using 3mAmp of floating current.. and 6.1 gain.. i want to have 0.1degree of accuracy and resolution..
the problem is my whole range is in between .6V.. and i have to set deltaVref to 0.6V.. to get my desire range..

if i increase my gain.. it will crosses to voltage limit of even 5V but the temp range is in .6 volt..

Please help

thanks
_________________
...
Ttelmah



Joined: 11 Mar 2010
Posts: 19347

View user's profile Send private message

PostPosted: Tue Mar 29, 2011 5:13 am     Reply with quote

You need to choose the gain, offset voltages applied etc., to condition the output to the range you require.

I have to 'ask' why on earth use a PT100 sensor for 20C to 40C?. The normal reason to use PT100 units, is for a much higher temperature range than this....

However a PT100 sensor, gives you a resistance change, not a voltage change. Depending on your particular sensor, you will have a resistance change, say of something like 106R for 17C to perhaps 116R for 41C.
Now you want to keep current through the sensor small. Ideally use something like a small voltage reference as a constant current source. If you choose a current of say 0.1mA, then self heating should be reasonable. If you are getting a 0.6v change across the sensor, then you are drawing an unacceptable current level (change of 10R 0.6v change, implies 60mA - accuracy will be destroyed by this....).
With 0.1mA the voltage across the resistor would change from 0.106v to 0.116v over the 17C to 41C temperature range. So use a op-amp 'adder', and subtract 0.106v, from the voltage, then have a gain of perhaps 300*. You'd then have an output swing from 17C to 41C, of 0v to 3v. Use a 3V reference, and the result will suit your PIC.
You would need to have a little bit of resistance after the op-amp, and clamp the swing after this to the Vref range, so that the PIC input is not overdriven if the voltage goes outside your required range.

Best Wishes
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