Page 1 of 1

ADC Using Vref-

Posted: Fri Feb 18, 2011 5:00 pm
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?

Re: ADC Using Vref-

Posted: Sat Feb 19, 2011 7:22 pm
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

Re: ADC Using Vref-

Posted: Mon Feb 21, 2011 12:36 pm
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?

Re: ADC Using Vref-

Posted: Mon Feb 21, 2011 12:56 pm
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.