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.

MSP430FR2153: ADC reference

Part Number: MSP430FR2153


Hi,

Doc SLAU445I - MSP430FR4xx and MSP430FR2xx family User's Guide, Table 21-8. ADCMCTL0 Register Description, says that I can set ADCSREFx to 000b = {VR+ = AVCC and VR– = AVSS }, and this will use "AVCC" as the ADC reference.

I am hoping that this is effectively DVCC - 3.3v in my case, and will allow me to measure anything in the system Vcc supply range.

Searching SLAU445I, SLASEC4D, and DOCNUM-2.91.13.01, I find no description of AVCC - it does not seem to appear on any pin. Can you confirm what AVCC actually is?

I also noticed a strange result reading the internal temperature sensor.

Before I discovered that the internal Vref has to be enabled, I took several readings and found that the internal temp was very low (single digits) when using AVCC as the ADC ref. It seems the internal Vref must be enabled, even when not using it for the ADC, to get a reasonable reading from the temperature sensor.

I initialised the ADC like this:

// Initialize ADC with ADC’s built-in oscillator
ADC_init (ADC_BASE, ADC_SAMPLEHOLDSOURCE_SC, ADC_CLOCKSOURCE_SMCLK, ADC_CLOCKDIVIDER_6);

// Setup sampling timer to sample-and-hold for 16 clock cycles
ADC_setupSamplingTimer (ADC_BASE, ADC_CYCLEHOLD_128_CYCLES, false);

// Configure the starting input channel and the Reference Voltages
ADC_configureMemory(ADC_BASE, ADC_INPUT_DVCC, ADC_VREFPOS_AVCC, ADC_VREFNEG_AVSS );
// ADC_configureMemory(ADC_BASE, ADC_INPUT_DVCC, ADC_VREFPOS_INT, ADC_VREFNEG_AVSS );

ADC_setupSamplingTimer (ADC_BASE, ADC_CYCLEHOLD_4_CYCLES, ADC_MULTIPLESAMPLESENABLE );

ADC_setDataReadBackFormat (ADC_BASE, ADC_UNSIGNED_BINARY );

ADC_setResolution ( ADC_BASE, ADC_RESOLUTION_12BIT );

// Enable the interrupt when each measurement is ready.
ADC_enableInterrupt ( ADC_BASE, ADC_COMPLETED_INTERRUPT_FLAG );

PMM_enableTempSensor();

// PMM_enableInternalReference();

// PMM_selectVoltageReference(PMM_REFVSEL_1_5V );

ADC_enable(ADC_BASE);

Then I triggered a sequence read to dump all channels to a memory array on interrupt.

Using AVCC as the ref and with the internal Vref disabled, i get:

Right most is DVCC input (max values as expected), next right is DVSS (0 as expected), the the disabled Vref, so quite low, then Temperature - 0x0027 seems very low.

Enabling Vref (un comment 2 lines in init above), I get:

Measured Vref is now 0x073D which, assuming ADC ref is 3.3v, gives 1.492v as expected.

Measures temperature is now 0x03E9 or 0.805v or about 40 Deg C, which seems reasonable.


Documents referenced.
SLAU445I - MSP430FR4xx and MSP430FR2xx family User's Guide
SLASEC4D - MSP430FR235x, MSP430FR215x Mixed-Signal Microcontrollers
DOCNUM-2.91.13.01 - MSP430 DriverLib for MSP430FR2xx_4xx Devices

Best regards

Jim Whitehouse

  • Hi Jim,

    I am looking into this thread and expected to give the feedback tomorrow.

    Thanks for your patience.

    B.R.

    Sal

  • Hi Jim,

    Can you confirm what AVCC actually is?

    I assume it is the DVCC, you can see the description here:

    It seems the internal Vref must be enabled, even when not using it for the ADC, to get a reasonable reading from the temperature sensor.

    I assume you should use the internal Vref for temperature sensor, because the temperature sensor is calibrated using the internal voltage references

    Also, it is mentioned in user's guide that the temperature sensor offset error can be large and must be calibrated for most applications (see the device-specific data sheet for parameters).

    B.R.

    Sal

**Attention** This is a public forum