This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

few ADC channel conversion output shows wrong output in RM48

Other Parts Discussed in Thread: HALCOGEN

Hi,

I am facing the problem in sensor interface.  I have interfaced totally 7 sensors to the ADC channel 1. in which channel 0 and 4 are giving the wrong output (compared with expected value or known value of sensor) .  I tried to short it out in different ways 

1. along with seven channel I have enabled the channel 8 and connected it to the ground then only channel 4 giving the wrong output. when i used

2.when I used only four channels from 0 to 3 all are working fine. 

Please help me to sort out the issue. sometimes after the power on/off the wrong output is switched to different channel.

attached the configuration of halcogen 

  • Manjunathan,

    Can you convert *only* the channel you are having trouble with by itself, and get the correct conversion result?
    Or do you get the wrong result if you do this too?
  • Sir,

    I have converter all the seven channels.

    I have used totally 7 channels (0 to 6). all the channels connected with sensor. only channel 0 and channel 4 giving the wrong result. other channel (1,2,3,5,6) results are correct.

    some methods i tried to rectify the problem

    1. to rectify this problem i enabled the 8th channel (channel no 7) and connect it to ground then the channel 0  and 4 is giving correct result but channel 5 is giving the wrong result. 

    2. if i enable only 4 channel and connect sensors to all 4 channels the output is correct. but i need to multiplex 10 sensors. 

  • Hi Manjunathan,
    Try to set up 7 for the fifo size, and/or check the channel id in the conversion results.
    Regards, Szilárd
  • Hi, Szilard.

    I have changed the fifo size and tried but the problem remains same. how to check the channel id in the conversion . i have attached the function. please help me to sort it out.

    i have not used channel id any where in my program other than the below program

    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;
    }

    this function will return the ADChex(6); 6-channel id

    float Paw()
    {
    ad = ADChex(6);
    adc2dec = (ad/0x100)*256 + ((ad/0x10)%0x10)*16 + (ad%0x10)*1 ;
    LP_AW=(adc2dec*1000)/819;
    LP_AW=LP_AW/1000;
    LP_AW =((-18.903*LP_AW*LP_AW*LP_AW*LP_AW)+(232.19*LP_AW*LP_AW*LP_AW)
    -(1063.6*LP_AW*LP_AW)+(2266.1*LP_AW)-1913.4);
    return LP_AW;
    }

  • Manjunathan,

    So what I am getting at is a simple question. I am trying to divide the problem space in half.

    The two 'halves' of the problem space in my mind are:

    a) problem with the sensor signal into the ADC channel that is giving you trouble.
    -> conversion result is never correct

    b) problem with the storage and retrieval of the conversion result
    -> conversion result is correct, but you never read it correctly from the ADC


    This is why I'm asking you to change your code to only convert the channel that you are saying gives the wrong sensor result. If you only convert this channel it would be very difficult to get 100% wrong results if there isn't a problem on the PCB with that signal .. [if you wind up missing a few correct results but most are correct I'd probably look at the FIFO configuration.. ]

    That's how I'd suggest attacking the problem. Otherwise you could spend days working on software to find out that there is a bad solder joint at the root of your issue.
  • Hi Antony,

    1.I have checked the input of ADC channel voltage using multimeter. in that shows the correct value,

    [b) problem with the storage and retrieval of the conversion result
    -> conversion result is correct, but you never read it correctly from the ADC] , Most probably this is the problem.

    If i convert the channel which gives only the wrong result  then the conversion result of that particular channel is correct.

    Thank you for the suggestions. i will try to short out the problem tomorrow and update the result

  • Hi Manjunathan,

    I don't agree with:

    "1.I have checked the input of ADC channel voltage using multimeter. in that shows the correct value"

    For several reasons.

    First one is that the multimeter doesn't sample the ADC channel at the same rate and with the same electrical characteristics as the ADC converter does.

    Second is that there could be a breakdown between where you are probing with the multimeter and where the signal is sampled by the MCU.
    [ solder joint issue, bad bond wire, etc.]

    So it's critically important IMO to understand whether or not in the simplest case of sampling just that problematic channel - you can get the correct conversion result or not.

    That's the only way to close the loop between the board level voltage and the digital result from the ADC.

    -Anthony