hi,
I am facing a problem while reading the group of ADC channel.
I have connected 10 sensors to my ADC channel 1 in RM48.
if i connect all the sensors it is working fine all the outputs are ok. if i disconnect one from the 10 all the ADC read outputs are getting affected and showing the wrong results.
I have attached the halcogen configuration and codes below. please suggest some ideas to solve the problem.
ccs codes:
uint32 ADChex(int i){
gioSetBit(gioPORTB, 0, 1);
while((adcIsConversionComplete(adcREG1,adcGROUP1))==0);
ch_count = adcGetData(adcREG1, adcGROUP1,&adc_data[0]);
ch_count = ch_count;
gioSetBit(gioPORTB, 0, 0);
return adc_data[i].value;
}
void airpr()
{
ad = ADChex(4);
adc2dec = (ad/0x100)*256 + ((ad/0x10)%0x10)*16 + (ad%0x10)*1 ;
HP_Air= (1.5608*adc2dec)/819 - 1.2835;
HP_Air = HP_Air*100;
}
Halcogen con: