ADC Using Vref-

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
beambase
Posts: 94
Joined: Wed Jul 29, 2009 5:15 pm
Has thanked: 6 times
Been thanked: 8 times

ADC Using Vref-

Post by beambase »

Hello
I am working on a project that requires a 18F4550 to read an analouge voltage between 0.5V to 4.5V. In the ADC component I can only find a settting to use the Vref+ input but nothing on how to enable the Vref- input. Is it possible to modify the ADC compnoent in some way?

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: ADC Using Vref-

Post by Jan Lichtenbelt »

Dear Beambase,

In the ADC properties you can choose for Vref-option: Vdd or Vref+. By choosing Vref+ you enable this option. Just put Vref+ on pin 5 of 18F4550 and it must work as you wish.

Succes

Jan Lichtenbelt

beambase
Posts: 94
Joined: Wed Jul 29, 2009 5:15 pm
Has thanked: 6 times
Been thanked: 8 times

Re: ADC Using Vref-

Post by beambase »

Hello Jan,
I know about the Vref+ function but I need to set the Vref- to 0,5V so the ADC will work between 0,5 - 4.5 V.
Does anyone else have any suggestions?

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: ADC Using Vref-

Post by Benj »

Hello,

To allow for Vref- functionality you will have to use the code customisation feature of v4 to edit the ADC sample component macro. The -Vref is simply a bit that is set or cleared in one of the ADCON registers. The device datasheet will show you exactly which bit and register to change and the +Vref bit of code should show you how to manipulate the register.

Post Reply