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.

MSP430G2231: Using ADC 10 With External VREF-

Part Number: MSP430G2231

I am doing some tests using the MSP430G2231 ADC10 and I am seeing unexpected results when using external VREF- . I am not sure if I have set something up incorrectly or I am misunderstanding how it should work.

In the test circuit I can alter the offset between VREF- and MSP430G2231 supply GND.  The input signal that I am reading is also offset with VREF- so that when measuring between the ADC input channel and VREF- the voltage reading is always constant regardless of the offset. I was expecting that the ADC reading would remain constant (within error margins) but what I am seeing is the ADC reading increases as the offset to GND is increased. 

 Any insight of advice would be appreciated.

 

This is how I have the ADC10 configured.  

WDTCTL = WDTPW + WDTHOLD;

BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;

ADC10AE0 |= BIT3 + BIT7;
ADC10CTL0 = SREF_5 + ADC10SHT_3 + REFON + ADC10ON;

ADC10CTL1 = INCH_7 + ADC10SSEL_2;
__delay_cycles(1000);
ADC10CTL0 |= ENC + ADC10SC;       
while (ADC10CTL1 & ADC10BUSY); 


Alastair

  • Hi Alastair,

    Please kindly note that your VREF+ is VCC which remains unchanged. So, while VREF- is changing, even if the difference between ADC input and VREF- is the same, the ADC conversion result will be changing accordingly.

    For example: let's say VCC = 3V
    While VREF- = 0V and ADC input = 1V, conversion result would be (1 - 0) / (3 - 0) * 1024 = 341
    While VREF- = 1V and ADC input = 2V, conversion result would be (2 - 1) / (3 - 1) * 1024 = 512

    So the ADC reading increases as your offset to GND is increased, which is the same as what you observed.
  • Hi Philo

    Of course, now I see it! I don't want to admit how many times I read the ADC section of the family guide and missed how it actually works.

    Thanks for taking the time to help.

    Alastair

**Attention** This is a public forum