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.

ADC10 accuracy



I am using an MSP430F6726. I measure input voltage (0V-2.1V). Is it posible to minimum binary value change is 8 not 1? For stable input voltage I have 111, 119, 127 instead 118,119,120 . Read voltage 1/s.


Initialization:

    while (REFCTL0 & REFGENBUSY) ;                  // If ref generator busy, WAIT
   // set reference
   REFCTL0 = REFVSEL_3 | REFMSTR | REFON;          // Select internal ref = 2.5V

  // Setup ADC10
  ADC10CTL0 = ADC10SHT_2 | ADC10ON;                 // S&H=16 ADC clks, Enable ADC10
  ADC10CTL1 = ADC10SSEL_1 | ADC10SHP ;              // ADCCLK = ACLK; sampling timer;

   ADC10CTL2 = ADC10RES;                            // 10-bit conversion results
  ADC10MCTL0 = ADC10SREF_1 | ADC10INCH_0;         // A0 ADC input channel select; Vref AVCC 2.5V

After 1 second measure start:

ADC10IE |= ADC10IE0;                           // Enable ADC conv cmplte interrupt
ADC10CTL0 |= ADC10ON |ADC10ENC | ADC10SC;   // Sampling and conversion start

  • So you mean, BIT0..2 are always set on your results? Strange. Could you please post the code where you read the result and process it?

  • Reading is very easy:

    pressSensorBinaryMeasurment - is UINT16_T

     pressSensorMeasurmentReady_Set() is flag

    __interrupt void procesorADC10_IntHandler(void)
    {
        switch (__even_in_range(ADC10IV, 12))
        {
            case  ADC10IV_NONE: break;                // No interrupt
            case  ADC10IV_ADC10OVIFG: break;          // conversion result overflow
            case  ADC10IV_ADC10TOVIFG: break;         // conversion time overflow
            case  ADC10IV_ADC10HIIFG: break;          // ADC10HI
            case  ADC10IV_ADC10LOIFG: break;          // ADC10LO
            case  ADC10IV_ADC10INIFG: break;          // ADC10IN

            case  ADC10IV_ADC10IFG:                   // ADC10
            {
                pressSensorBinaryMeasurment = ADC10MEM0;
                pressSensorMeasurmentReady_Set();

                procesorADC_MeasureOff();

                break;
            }

            default: break;
        }
    }//procesorADC10_IntHandler

  • Jan Gr��dzki said:
                pressSensorBinaryMeasurment = ADC10MEM0;

    What you do _after_ value is read? Maybe your code mess-up data or output?

    I suggest you to run this code in the debugger, set breakpoint after ADC read and check what kind of data you are getting from ADC. If you are not running ADC out of specification (on too high clock freq for instance), then you shall be getting readings with 1 count granularity

**Attention** This is a public forum