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.

TMDSIDK437X: AM437x - ADC0 Issues

Part Number: TMDSIDK437X


I'm trying to use ADC0 as a general purpose ADC, but have been having some issues on getting accurate readings from the different channels. I'm using the adc example project and modified it to (what I think is) general purpose mode.


    adcStepCfg.adcNegativeInpRef = TSCADC_NEGATIVE_REF_VSSA;
        adcStepCfg.adcPositiveInpRef = TSCADC_POSITIVE_REF_VDDA;
        adcStepCfg.adcNegativeInpChan = TSCADC_INPUT_CHANNEL1;
        adcStepCfg.adcPositiveInpChan = TSCADC_INPUT_CHANNEL1;
        adcStepCfg.enableXppsw = FALSE;//TRUE
        adcStepCfg.enableXnpsw = FALSE;
        adcStepCfg.enableYppsw = FALSE;
        adcStepCfg.enableXnnsw = FALSE;//TRUE
        adcStepCfg.enableYpnsw = FALSE;
        adcStepCfg.enableYnnsw = FALSE;
        adcStepCfg.enableWpnsw = FALSE;

    /* Enable ADC for GP mode. */
    TSCADCTSModeConfig(pCfgAdc->instAddr, TSCADC_MODE_GP_ADC);

The code above is used to set-up the set config register and set the mode. I do this for the first 4 channels (AIN0-AIN3), but not getting expected results. If I apply no voltages to any pin, some pins read back a value. But if I apply voltage to pin 31 on the J1 header (AIN0) I notice the outputs for AIN0 and AIN1 both change. If I apply voltage to pins 37 and 39, there are no changes in the values read for AIN2 and AIN3 and they constantly read 0.

Here is the output from the test running

AN0 : 895mV -- AN1: 830mV -- AN2: 0mV -- AN3: 0mV
AN0 : 881mV -- AN1: 811mV -- AN2: 0mV -- AN3: 0mV
AN0 : 895mV -- AN1: 830mV -- AN2: 0mV -- AN3: 0mV
AN0 : 881mV -- AN1: 816mV -- AN2: 0mV -- AN3: 0mV
AN0 : 889mV -- AN1: 825mV -- AN2: 0mV -- AN3: 0mV

Is there some set-up for the ADC I'm missing to get it to output more proper values such as 0 with no voltage applied and increase when I apply voltages?