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.

TMS320F2808: Query AdcRegs.ADCRESULT result value

Part Number: TMS320F2808

hello.
I have a question regarding the TMS320F2808 ADC.

The default settings are as follows.

AdcRegs.ADCTRL1.bit.RESET = 1U;
InitAdc(); // For this example, init the ADC
AdcRegs.ADCTRL1.bit.ACQ_PS = 0x0fU;
AdcRegs.ADCTRL3.bit.ADCCLKPS = 1U;
AdcRegs.ADCTRL1.bit.SEQ_CASC = 1U; // 1 Cascaded mode
AdcRegs.ADCMAXCONV.bit.MAX_CONV1 = 10U;
AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0U;
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x1U;
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 0x2U;
AdcRegs.ADCCHSELSEQ1.bit.CONV03 = 0x3U;
AdcRegs.ADCCHSELSEQ2.bit.CONV04 = 0x4U;
AdcRegs.ADCCHSELSEQ2.bit.CONV05 = 0x5U;
AdcRegs.ADCCHSELSEQ2.bit.CONV06 = 0x6U;
AdcRegs.ADCCHSELSEQ2.bit.CONV07 = 0x8U;
AdcRegs.ADCCHSELSEQ3.bit.CONV08 = 0x9U;
AdcRegs.ADCCHSELSEQ3.bit.CONV09 = 0x0AU;

AdcRegs.ADCTRL1.bit.CONT_RUN = 1U; // Setup continuous run
AdcRegs.ADCTRL2.all = 0x2000U;
AdcRegs.ADCTRL1.bit.RESET = 0U;


then next
void main(void)
{

   while(1)
   {
      if(10msCycleTmr != sPrevIntAdcCycle) // 10ms cycle
      {
         if(AdcRegs.ADCST.bit.INT_SEQ1 == 1U)
         {
            RegisterVal[0] =((AdcRegs.ADCRESULT0 >> 4) );
            RegisterVal[1] =((AdcRegs.ADCRESULT1 >> 4) );
            RegisterVal[2] =((AdcRegs.ADCRESULT2 >> 4) );
            RegisterVal[3] =((AdcRegs.ADCRESULT3 >> 4) );
            RegisterVal[4] =((AdcRegs.ADCRESULT4 >> 4) );
            RegisterVal[5] =((AdcRegs.ADCRESULT5 >> 4) );
            RegisterVal[6] =((AdcRegs.ADCRESULT6 >> 4) );
            RegisterVal[7] =((AdcRegs.ADCRESULT7 >> 4) );
            RegisterVal[8] =((AdcRegs.ADCRESULT8 >> 4) );
            RegisterVal[9] =((AdcRegs.ADCRESULT9 >> 4) );

            AdcRegs.ADCST.bit.INT_SEQ1_CLR = 1U;
         }
         sPrevIntAdcCycle = 10msCycleTmr;
      }
   }
}

I am measuring ADC like this.

Could it be that the value of AdcRegs.ADCRESULT can be converted to an intermediate value rather than the final value?
I wonder if AdcRegs.ADCRESULT only shows completed values.


thank you

  • HyunSang,

    Could it be that the value of AdcRegs.ADCRESULT can be converted to an intermediate value rather than the final value?
    I wonder if AdcRegs.ADCRESULT only shows completed values.

    Your final statement is correct, the ADCRESULT registers will only show completed/fully converted values.  This is even true on any boundary condition of old/new data; there will never be an intermediate value populated in these registers.  Worst case in this scenario if the read is too early you would get the old data vs the new.

    Best,

    Matthew