Dear friends,
I am using Pic16f876a in my project,I wanted to read 2.5v through ADC,my result will be 10 bit ..I am using pickit 3 for debugging. I have made a function called "adc_read()",which will read the analog voltage and returns the result.in the "adc_read()" function i have used an int variable called "result",which will store the converted 10 bit result.My problem is the value i see in the "adc_read()" is different from what it return. example:
int a=0;int adc_read(char channel);
void main(){a=adc_read(4);...............................}........
in the adc_read() function variable "result" will be showing 455 ,but after the return operation variable 'a' will be showing 349. please help... i am using high tech c as compiler