Advice on ADC Resolution settings

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Advice on ADC Resolution settings

Post by Steve001 »

Evening All

Just playing about with a ECIO40P and two LM35 temperature sensors these are connected to port E

I am wanting better resolution i know about vref voltage and V ref options

can someone explain these settings as i have not played around with these settings before. What effect will it have to the other analogue inputs ?

Steve
Success always occurs in private and failure in full view.

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:

Re: Advice on ADC Resolution settings

Post by Benj »

Hi Steve,

The VREF voltage is simply used as a multiplier by the ReadAsVoltage and ReadAsString macros to provide a floating point voltage value, it makes no difference to the binary ADC reading resolution.

The VREF options allow you to switch between VCC, VREF+ and on some devices a fixed internal reference.

If you use the VREF+ mode and provide a fixed voltage to the VREF+ pin lower than VCC then it will allow a finer resolution to the ADC channel but the max voltage will be lower.

Any changes you make to a single ADC channel should not effect other ADC channels.

The conversion speed and pre-charge time are also key elements to play around with to get the best possible results.

Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times

Re: Advice on ADC Resolution settings

Post by Steve001 »

Hi Ben

Thank you for that will have a go. Found that you can read the ADC with 10 or 12 bit last night what difference would going down this route make ?

http://www.flowcode.co.uk/wikiv7/index.p ... bit_sample

Steve
Success always occurs in private and failure in full view.

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:

Re: Advice on ADC Resolution settings

Post by Benj »

Hi Steve,

The ADC bit depth is based on the device.

Reading as a byte and the returned value will always be in the range 0-255.

Reading as an int and the returned value should automatically default to the max available bit depth of the ADC on the device your using.

The device datasheet will tell you how many bits the ADC is capable of but you can also use the Device Helper component from the Tools Component Menu which lists amongst other things the current target's ADC max bits.

10-bit = 0-1023
12-bit = 0-4095

Post Reply