Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ADC in a micro - actual use of -Vref

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
Thinking of ADC in a PIC 18F micro.

I need to perform AD conversions of a single ended signal ranging between 2900 and 3700 mV. By design I know that it cannot escape from there.

To increase resolution I should bring those values down to the 0 - 800 mV range and reduce Vref as much as the micro allows (and as long it is equal or higher than 800 mV), always with -Vref to ground. For the moment, I cannot change the level of the input range, so I am left playing only with Vrefs.

Today, reading the manual of a micro, I realized the possibility of deciding on the +Vref and -Vref settings. I never had clear what is the use of -Vref :(, thus my questions:

a) For my range 2900-3700 mV, would it make sense to set: +Vref =5,0V and -Vref =4,2V?

b) If the above is just stupid, could anyone at least give a concrete example of what's the use of -Vref? Kind of a grey area to me.

Gracias for any reply.
 
With out looking at the data sheet for the PIC18F......
You could set +Vref at4.7V and -Vref at 2.9V. (in 8 bit mode) ADC of 0 at 2.9V and ADC of 255 at 4.7V.

If you set +Vref at 5V and -Vref at 2.5V you would double the resolution.
>>A LM431 can make a good 2.5V.
 
which pic 18? and is 8 bit for speed?
 
and is 8 bit for speed?
In this case he probably wants the highest resolution possible and speed is not as important.
Because I don't know the resolution I used "8 bit" as an example. I was trying to point out the DAC will measure form (-) to (+).
 
In this case he probably wants the highest resolution possible and speed is not as important.
Because I don't know the resolution I used "8 bit" as an example. I was trying to point out the DAC will measure form (-) to (+).
Got you, sorry it confused me a bit. I asked the part number because I cant remember which of the 18f's I used had a limit on the difference between -REF and VDD, it probably wont apply but was going to check.
 
Last edited:
Can you set -vRef at 2900-mV and +vRef at 3923-mV to provide 1-mV resolution on the ADC result (voltage = ADC result 0..1023 + 2900)?
 
I'm no guru on ADC ( mainly PIC24) but had acceptable results using 12 bit resolution ie 4096 steps and internal reference voltage of 4.096v or 2.048v as +ref -ref Vss whatever is available or external of same v . I get stuck on ADC timings and have to 'experiment'.
 
Can you set -vRef at 2900-mV and +vRef at 3923-mV to provide 1-mV resolution on the ADC result (voltage = ADC result 0..1023 + 2900)?
Hi Mike, I think everyone else is trying to avoid that suggestion lol, the next question would be....how do I get an accurate reference for 3923 mV :D. More seriously though how far over is the wiggle room? Does it NEVER go above or below those two points? I am guessing some kind of sensor?
 
Mike - K8LH" said:
Can you set -vRef at 2900-mV and +vRef at 3923-mV to provide 1-mV resolution on the ADC result (voltage = ADC result 0..1023 + 2900)?
Hi Mike, I think everyone else is trying to avoid that suggestion lol, the next question would be....how do I get an accurate reference for 3923 mV :D.
I was just asking if it was possible. I've never used anything other than ground for -Vref.

If you did want to use those references, couldn't you route the 4.096v FVR (Fixed Voltage Reference) output to an I/O pin and attach a couple ten-turn pots between that pin and ground with the wipers connected to the -Vref and +Vref input pins?

That's probably quite a bit of work to get 1-mV resolution when you consider that grandad's suggestion for using the 4.096v FVR for +Vref will provide 4-mV resolution for a 0..4096-mV input when using a 10-bit ADC.

Cheerful regards, Mike
 
Last edited:
Hi Mike I will read some sheets, I think if it can be used like this then I for one have overlooked a very useful feature for a long time!!
How many threads asking about 1mV resolution etc etc. I might play with this later.

Still in the back of my mind is a vague memory of some limitation or other with the -Ref, so rather than guess I will go read ::D
 
Thanks to RonS, Mike and GD for replying.

Good to know I was not that much out of track.

After reading all datasheets, the best micro I got here is the 18F4431 with a minimum delta Vref=1,5V (but no FVR on board).
 
Thanks to RonS, Mike and GD for replying.

Good to know I was not that much out of track.

After reading all datasheets, the best micro I got here is the 18F4431 with a minimum delta Vref=1,5V (but no FVR on board).

What am I? Chopped liver? What other chips you got?
 
I gave up trying to get 1 mV res ( 12 bit 4.096v +ref ) as my circuit was tooooooooo noisy ! taking an average of 10 reads gave best result .
I found this a problem PIC 24 A/D SAMPLING REQUIREMENTS " To minimize the effects of pin leakage currents on the accuracy of the A/D Converter, the maximum recomended source impedance, RS, is 2.5 k ohm"
 
Last edited:
LOLOL ok you been found ot! I am on ignore lmao, thats why he dosnt see what Jim is saying :D. Jim your going to have to explain he has been found out lol. I wish the software told you who was ignoring you, I have read data sheet after data sheet for him and couldnt have posted it anyway as he wouldnt of seen it :p.
 
you mean that I could use an external voltage reference?
Typically:
-Vref is connected to ground
+Vref can be connected to +supply but a +5V supply is not as good as a real reference
+Vref can be connected to a reference like 4.024V or 2.5V or......

SO

We are saying that +Vref can go to +5V and -Vref can go to a reference just as well.
upload_2016-1-30_11-5-23.png

Vsup is you 5V.
Rsup could be 1k to 2k. Needs to have 1 to 10mA of current.
R1 and R2 should be in the 10k range.
Vo is set by the formula. If R1=10k and R2=10k then Vo=2.5V Increasing R1 will increase the voltage.
Cl could be 0.1uF
TL431 is a little "transistor" looking thing. Three legs.
 
Thanks Ron for the details

TL431 is a little "transistor" looking thing. Three legs.

Maybe around 20 years ago I've seen one literally melting on a protoboard. Brave, it worked until the last moment.:wideyed:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top