0

I am using PIC18f452 in boost converter. For the control of Boost converter output voltage (200V) , i used feedback resister (R1=99K ohm , and R2 =2.5K ohm). The voltage across R2 is 5V with the input 200V.

V2 = (2.5)/(99+2.5) *200 = 4.92 V

when i want to measure the voltage at controller . i connected the controller pin to R2 resister for measurement. The value of V2 derease to 2.3V. its value never increase to 4.9 voltage. after that i disconnect the chanal ,then i measured again , its value correct that was 4.9 volts. now i am confused , what is the problem with controller. why the value of v2 decreases to 2.3v from 4.9v while connecting to microcontroller pin for measurement of this voltage .

the code s attached here. you can see the configuration of pins .

void main() {

ADCON1 =1;

PORTC = 0;

TRISC = 0;

PORTA = 0;

TRISA = 0xFF;

ADC_Init();

Misal313
  • 169
  • 2
  • 8
  • 23

3 Answers3

1

There can be a lot of reasons for that.

  1. Wrong ADC TAD time, check datasheet.
  2. To short ADC sample time, check datasheet.
  3. You are using ADC configuration (ADCON1 =1) with reference Vref+ on AN3 so is 5 VDC on that pin?
  4. You are using to high ADC input impedance for good ADC results. The maximum recommended impedance for analog sources is 2.5 kΩ, check datasheet. (You need to put a small cheramic cap. parallel to PIN or buffer the input with OP amplifier.)
GJ.
  • 10,810
  • 2
  • 45
  • 62
0

You have to take care of internal ADC resistance. Connecting divider directly to pin probably would end up with changing signal characteristics. I would strongly recommend adding op amp buffer or changing the value of divider resistors.

Darko Djuric
  • 754
  • 4
  • 10
0

I had similar problem and solved it like Darko suggested, using a OpAmp voltage buffer. You can use any Opamp, I used Microchip's MCP601. This lowered the ADC input impedance to almost nothing.

At the same time, I increased your resistor's to ten times larger resistors, so they do not load the circuit you are measuring. It is not necessary, but why not to do it, when OpAmp allows it.

EmbeddedGuy
  • 349
  • 2
  • 11
  • Dear @EmbeddedGuy , i used buffer Opam for ADC . but the opam givve the 1.8v output till the output is less than is 1.8v. mean its value remain 1.8v from input voltage 0v-1.8 v . at higher value of 1.8v , it changes the the value. so i want to read less voltage. so it can be possible – Misal313 Jun 29 '16 at 19:41
  • I would like to see your schematic of the OpAmp buffer section, including the input resistors and output connection to PIC. It should go down to almost zero volt, not only to 1.8 volt. – EmbeddedGuy Jul 09 '16 at 03:00