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 setup external ADC Reference with VREF pin?

Other Parts Discussed in Thread: TM4C1294NCPDT

I'm trying to use an external voltage reference  with the Tiva C LaunchPad ADC - but for some reason it just won't use it...

I followed the instructions on http://www.ti.com/lit/ds/symlink/tm4c1294ncpdt.pdf page 1164 and 1861. The latter page states:

"VREFA+ = Positive external voltage reference for ADC, when VREF field in the ADCCTL register is 0x1"

I assume "VREFA+" is the "VREF" pin 34 (see http://www.ti.com/lit/ug/spmu365a/spmu365a.pdf page 15) on the Tiva C LaunchPad and I got a REF5040 divided to 3.079V connected to that pin.

This is the code I'm setting things up with:

#define ADC_REF_EXT_3V          0x00000001  // External 3V reference

void ADCInit(void) { MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1); MAP_ADCReferenceSet(ADC1_BASE, ADC_REF_EXT_3V); // this define is 0x1 like demanded by page 1861 MAP_ADCHardwareOversampleConfigure(ADC1_BASE, 1); MAP_ADCSequenceConfigure(ADC1_BASE, 3, ADC_TRIGGER_TIMER, 0); MAP_ADCSequenceStepConfigure(ADC1_BASE, 3, 0, ADC_CTL_CH3 | ADC_CTL_IE | ADC_CTL_END); MAP_ADCSequenceEnable(ADC1_BASE, 3); MAP_ADCIntEnable(ADC1_BASE, 3); MAP_IntEnable(INT_ADC1SS3); MAP_ADCIntClear(ADC1_BASE, 3); } void ADCPinInit(void) { MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); MAP_GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_0); }

However, all the samples I get are based on the internal voltage reference - exactly like setting

MAP_ADCReferenceSet(ADC1_BASE, ADC_REF_INT);

Am I missing something here or is this feature somehow broken on the Tiva C? Unfortunately I couldn't find anything on this issue yet...

Do I also get page 1861 right, that only 2.4V - 3.3V references are supported and there is no way around this?

  • Hello Cedric,

    How have you configured the ADC Analog Inputs. That is is not mentioned in your code.

    Regards

    Amit

  • Hi,

    On my C board, the micro is indeed NCPDT - but both the user manual and schematics show up REFA+ pin single, fixed, on pin 9, not 34. GNDA is  pin 10.

    Also, there is REF5030, really with 3.000V - you can use it without additional divider.

    If using the external reference, take care to remove R41 from the board.

    Petrei

  • Thank you both for the quick answers.

    I updated the first post with the pin configuration.

    As for the VREF pin: I mean the pin on the side of the LaunchPad, not the pin number of the chip. According to http://www.ti.com/lit/ug/spmu365a/spmu365a.pdf page 15 it is pin 34...

    Is removing R41 mandatory for using an external voltage reference?

  • Hi,

    Yes, absolutely - see the schematic in board's user manual.

    Also, to avoid confusing pin names in the future, suggest to name the pin prefixed by connector name, like X1-34.

    Petrei