Part Number: AM13E23019
Other Parts Discussed in Thread: SYSCONFIG
Hello,
I have am AM13E23019 with an external 3.0v vref attached. In Syscfg I set VREFSource to external
sysctl.VREFSource = "DL_SYSCTL_VREF_EXTERNAL";
Which sets SOCLOCK.ANAREFCTL to DL_SYSCTL_VREF_EXTERNAL (0x001).
But my ADC reading were about half of what they should be. This seems related to the internal divide by two used for interal 3.3v vref. From the reference manual:
When the 1.65V internal reference voltage is selected, the ADC input signal is internally divided by 2 before conversion, which effectively makes the ADC conversion range from VREFLO to 3.3V.
The reference manual also says
To enable the external reference mode, the bit ANAREFSEL in register REFCONFIGA from AnalogSubsysRegs must be set to 1 (AnalogSubsysRegs.REFCONFIGA.bit.ANAREFSEL = 1).
but then doesn't define which bit in REFCONFIGA is ANAREFSEL

I was able to resolve this by configuring both 2.5v internal and external vref, which I think disabled the internal vref connection and disables the internal divide by two.
SOCLOCK.ANAREFCTL = DL_SYSCTL_VREF_EXTERNAL | DL_SYSCTL_VREF_INTERNAL_2_5_V; (0x101)