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.

Vcc as a reference on MSP430F5529

Expert 1140 points
Other Parts Discussed in Thread: MSP430F5529

Hi,

I'm porting the g2553 code to f5529 and stumbled upon the voltage reference for the ADC. The g2553 had an SREF_0 in ADC10CTL0 register which ADC12 in f5529 lacks. TI recommends using REF module to generate voltage references but still I didn't find other options than 1.5/2/2.5 V.

In my device I have a simple voltage divider based on the potentiometer that is connected to Vcc and which I want to probe so the internally generated voltage references are not what I need. 

Section 28.2.3 of slau208m says that: "The ADC12_A modules have a separate reference module (REF) that supplies three selectable voltage levels, 1.5 V, 2.0 V, and 2.5 V to the ADC12_A. Any of these voltages may be used internally and externally on pin VREF+. The internal AVCC can also be used as the reference".

I assume I can connect the AVcc directly to Vcc, the question is though how to set ADC12 to use the reference voltage of Avcc?

As for the part marked orange: does the statement means that the REF-generated voltage is available as the output on the VRef+ pin of f5529 (P5.0)?

Best Regards,

tml

  • tml said:
    he g2553 had an SREF_0 in ADC10CTL0 register which ADC12 in f5529 lacks.

    The 5x family has ADC10_A while the G2553 has ADC10. The A version has moved channel selection and reference selection into the ADC10MCTL register. While basically the same, teh A version has added some new functionality and the DTC is gone (the 5x family has a general-purpose DMA)

  • Thanks Jens-Michael! It solved my problem ;-)

    One more question: is there any rule for register value #define's (in this case mspgcc, but I think the same is for CCS or IAR), let's see file msp430f5529.h file:

    /* ADC12CTL0 Control Bits */
    #define ADC12SHT03 (0x0800) /* ADC12 Sample Hold 0 Select Bit: 3 */

    /* ADC12CTL0 Control Bits */
    #define ADC12SHT0_3 (0x0300) /* ADC12 Sample Hold 0 Select Bit: 3 */

    How should I know I should use for ADC12CTL0 the ADC12SHT03 instead of ADC12SHT0_3?

    In fact some F55xx examples use ADC12SHT02 and other use ADC12SHT0_2, by looking at the data sheet I guess I should use ADC12SHT0_2 as it is mapped onto one of 16 different possible SHT options. That's tricky, as one of the bit values use underscores and the other don't....

  • tml said:
    is there any rule for register value #define's

    Yes. XXXXy defiens bit y in the XXXX bitfield. XXXX_y defines the enumertated option y, combined of the bits in a register.

    So ADC12SHT0_3 equals (ADC12SHT00|ADC12SHT01) while ADC12SHT0_0 equals 0x00.

    ADC12SHT0 is a bit tricky, as the register name ends with a number itself. Luckily, there are no (independent) MSP config registers with a register index >9. :)

    In addition, there might be a define for the meaning of the option, like WDTCTL_ADLY_1000, which defines the bit combination for  WDT delay mode, ACLK, 1000ms. If this descriptive value is a number (e.g. ADC12SHT0__4 for 4 ticks), then two underscores are used, to separate it from the enumeration.

**Attention** This is a public forum