All content and materials on this
site are provided "as is". TI and its respective suppliers and providers of content make no representations about
the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these
materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a
particular purpose, title and non-infringement of any third party intellectual property right. No license, either
express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a
license from a third party, or a license from TI.
The ADC driver enables the digital input buffer when configuring the IO pin(s) for the ADC.
{code}/* Add pin to measure on */
adcPinTable[i++] = hwAttrs->adcDIO | PIN_INPUT_EN;{code}
That is not correct and will lead to increased current consumption in the IO, possibly also affecting the ADC measurement.
The correct configuration of the IO for ADC usage is with both the input- and output buffers disabled and no pull- enabled (the reset setting for the IOC).
I suggest the driver is changed to explicitly configure the IO back to its reset state, just in case something else has altered its configuration before being used by the ADC driver. Like this:
{code}//IOC configuration used in TI testing - basically reset configuration for the IOC register.
#define IOC_ADC (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
IOC_HYST_DISABLE | IOC_NO_EDGE | \
IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
IOC_NO_WAKE_UP | IOC_INPUT_DISABLE | \
IOC_JTAG_DISABLE){code}
The ADC driver enables the digital input buffer when configuring the IO pin(s) for the ADC.
{code}/* Add pin to measure on */
adcPinTable[i++] = hwAttrs->adcDIO | PIN_INPUT_EN;{code}
That is not correct and will lead to increased current consumption in the IO, possibly also affecting the ADC measurement.
The correct configuration of the IO for ADC usage is with both the input- and output buffers disabled and no pull- enabled (the reset setting for the IOC).
I suggest the driver is changed to explicitly configure the IO back to its reset state, just in case something else has altered its configuration before being used by the ADC driver. Like this:
{code}//IOC configuration used in TI testing - basically reset configuration for the IOC register.
#define IOC_ADC (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
IOC_NO_IOPULL | IOC_SLEW_DISABLE | \
IOC_HYST_DISABLE | IOC_NO_EDGE | \
IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
IOC_NO_WAKE_UP | IOC_INPUT_DISABLE | \
IOC_JTAG_DISABLE){code}