Vref for ADC.

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time

Vref for ADC.

Post by KeithSloan »

I would like to measure voltage down to a resolution of millivolts. I therefore assume that I need a Vref of 1 volt. What is the best way of providing the Vref of 1 volt. Is a tap between a couple of resistors from 5volt supply good enough or is something more sophisticated required. How about current? or does one just use high valued resistors.

From reading the datasheets I assume I make Ra3 the Vref and set the appropriate control memory/register

Out of interest how low could one go with Vref. Obviously a 10 bit ADC means the resolution is Vref/1024.

Many Thanks Keith

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Keith

This topic in the Flowcode forum should help.

http://www.matrixmultimedia.com/mmforum ... php?t=3181

As for getting an accurate 1V. It may be easier to use a Zener diode or a regulator to acheive an accurate ref voltage. If you are using a resistor based potential devider then there will definatley be error in the resistance values and possibly error in the 5v regulated voltage.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time

Post by KeithSloan »

Thanks for the info.

I am a bit concerned about the bit that says

[NOTE: I wrote all of this without realising you cannot use RA3 as the Vref+ pin, but it's all still relevant to anyone who has Vref+ free. I will give you another answer in another post]

May I assume that this is a Flowcode limitation.

Any ideas how low one could go with Vref?
Can you get 1v Zener diodes? I thought there were limited voltage choices.

Many Thanks Keith

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

The ADC component of Flowcode does not currently allow the use of Vref+ and Vref- pins. However, a simple edit of the FCD file for the chip you intend to use will allow you to use them.

As for the zener, Ben will answer that.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

I've just had a quick look at zener diodes and the lowest i found was 2.4V. This will still give you just over twice the accuracy that you would have with 5V.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

If you post of the exact PICmicro that you intend to use then I can provide you with the modification to use on the FCD file.

KeithSloan
Posts: 114
Joined: Fri Jul 27, 2007 10:50 am
Been thanked: 1 time

Post by KeithSloan »

Thanks

But I don't have use flowcode so not a problem as long as I can use Vref/RA3 from assembler

Keith

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Ah ok then yes that should work fine.

Let us know if you have any problems.

Post Reply