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.

How to configure ADC10 on MSP430F5508 to read battery voltage and what do each of the commands in ADC10CTL and ADC10MCTL mean?

Other Parts Discussed in Thread: MSP430F5508

I am configuring ADC10 of msp430f5508 to read the battery coltage connected to a pin.

I need to configure the ADC and then enable that pin (How?) and then read the value.

What commands do I need?

  • Hardik,

    I would recommend to start with the code examples given by TI - you can find them here. The ADC10 examples are

    • MSP430F550x_adc10_01.c    ADC10, Sample A0, AVcc Ref, Set P1.0 if A0 > 0.5*AVcc
    • MSP430F550x_adc10_02.c    ADC10, Sample A0, 1.5V Shared Ref, Set P1.0 if A0 > 0.5V
    • MSP430F550x_adc10_03.c    ADC10, Sample A10 Temp, TA0.1 Trigger, Set P1.0 if Temp++ ~2C
    • MSP430F550x_adc10_04.c    ADC10, Sample A1, Signed, Set P1.0 if A1 > 0.5*AVcc
    • MSP430F550x_adc10_05.c    ADC10, Sample A11, Lo_Batt, Clear P1.0 if AVcc < 2.3V
    • MSP430F550x_adc10_06.c    ADC10, Internal Reference toggle
    • MSP430F550x_adc10_07.c    ADC10, DMA Sample A1 64x, AVcc, Repeat Single, DCO
    • MSP430F550x_adc10_10.c    ADC10, DMA Sample A2-0, 8-bit Res, Single Sequence, DCO
    • MSP430F550x_adc10_11.c    ADC10, Sample A0, 1.5V Ref, TA0.1 Trig, Set P1.0 if A0>0.5V
    • MSP430F550x_adc10_12.c    ADC10, Sample A5, 1.5V Ref, TA0.0 Trig, Ultra-Low Pwr
    • MSP430F550x_adc10_13.c    ADC10, DMA Sample A1 32x, 2.5V Ref, TB0 Trig, DCO    
    • MSP430F550x_adc10_14.c    ADC10, DMA Sample A1-0 32x, AVcc, Repeat Seq, DCO
    • MSP430F550x_adc10_15.c    ADC10, DMA Sample A11 32x to Flash, Int Ref, DCO
    • MSP430F550x_adc10_21.c    ADC10, Window Comparator, 2.5V ref, Timer trigger, DCO

    I guess there are useful examples for your application, too.

    Dennis

  • Thanks Dennis!
    You always help me out..
  • I am also going through the msp430userguide to understand all the registers and control variables.
    Would refer to these programs as well!!
  • The user's guide is a nice document, too - but no need to read it completely :) But always good to know how the peripherals work, so having a look in the user's guide isn't a bad idea. And to understand the meaning of the register names it is absolutely necessary to work with it.