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.

msp430 adc

Other Parts Discussed in Thread: MSP430F155

Hi I am bit new to msp430 controller,

     In my project i am using msp430f155 controller.....In adc if i use external reference my result will be correct ....but if  i am using internal reference  generator my answer is some what wrong...my input analog signal is 0.5V and external reference is 3.06V and the conversion answer is near to input signal(0.499V)....but in my internal reference case 0.5v and REF2_5V(2.5V) i got 0.410V......this my coding so please help ...

    Thank YOU........!

WDTCTL = WDTPW+WDTHOLD;                  
  P6SEL = 0x01;                            
  ADC12CTL0 = ADC12ON+SHT0_8;      
                                           
  ADC12CTL1 = SHP;               
  ADC12MCTL0 = INCH_0;                    
                 
  ADC12IE = 0x01;                          
  ADC12CTL0 |= ENC;                        
  ADC12CTL0 |= ADC12SC;

  • If that is your code for the 2.5 volt case you are missing to set the ADC12REF2_5V and ADC12REFON in the ADC12CTL0.

    Also you have to set SREF_1 in ADC12MCTL0, otherwise it will not use the internal reference.

    You also might want to use a _delay_cycles(x) after enabling the reference to allow it to settle. See also this note from the user guide:

    For proper operation the internal voltage reference generator must be
    supplied with storage capacitance across VREF+and AVSS. The recommended
    storage capacitance is a parallel combination of 10-μF and 0.1-μF capacitors.
    From turn-on, a minimum of 17 ms must be allowed for the voltage reference
    generator to bias the recommended storage capacitors. If the internal
    reference generator is not used for the conversion, the storage capacitors are
    not required.

    So you can get the needed cycles to delay by calculating 17ms*clock frequency.

    I assume you have placed the capacitors needed?

**Attention** This is a public forum