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.

adc problem in tms320f28069

 Hello,

     I am simply reading the adc channel 0. The same value i am passing in two different variables. It should be same but i am getting different reslut in both variables... I am not getting why this is happening... i am giving fix 3.3 v at adc channel 0. Still the problem with same.

    I have check this with given example code adc_soc...things are same...

   why readings are not same as i am accessing the same value in different variables?? 

   Can anybody help on this???

 

  • Hello,

     please see the attchament

    thanks in advance...5584.Presentation1.ppt

  • Hi Trupti,

    Please check with the below code:

    temp = ((AdcRegs.ADCRESULT0>>4) );

    Also, there will be some noise; so both temp1 and temp2 even though are fed with the same ADCRESULT0 register, they vary. Check 3V DC input and revert.

    Regards,

    Gautam

  • hi gautam,

       though noise will be ther still it has to show the same reading...ri8??

      please check the code...ti have already post the ppt for this...

    interrupt void adc_isr(void)
    {

    temp1 = AdcResult.ADCRESULT0;
    temp2= AdcResult.ADCRESULT0;

    AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //Clear ADCINT1 flag reinitialize for next SOC

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; // Acknowledge interrupt to PIE

    return;


    }

  • Trupti, actually while serving the above ISR, ADCRESULT0 should have same values and not instantaneous. You're right... but please check by activating the step by step debug mode. Specially check when are the values getting updated in temp1 and temp2.

    Regards,

    Gautam

  •  Hi gautam,

          after doing debugging i was getting same value but when i have started real time mode the value was not same. so i have passed the same variable on modbus at that time i am getting the same values in both the variable.

         gautam can you plz tell me Is there any precaution i have to take when i am checking values in real time mode in code composer studio??

         n thanks...

  •  gautam can you plz tell me Is there any precaution i have to take when i am checking values in real time mode in code composer studio??

    If you're talking about ADC values.... then don't keep any test points near adc pins as they're very sensitive and you'll get GEL errors due to static charges.  

    Regards,

    Gautam