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();