Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: AM335x ADC question

$
0
0

Hi,  Jeethan

I checked by disabling these registers that you have pointed out.

Please check the following code.

~~~~

/* ADC is configured */

static void ADCConfigure(void)

{    

/* Enable the clock for touch screen */    

    TSCADCModuleClkConfig();

    TSCADCPinMuxSetUp();

    /* Configures ADC to 3Mhz */    

    TSCADCConfigureAFEClock(TSC_ADC_INSTANCE, 24000000, 3000000);

    /* Disable Transistor bias */  // <--- modified    

    TSCADCTSTransistorConfig(TSC_ADC_INSTANCE, TSCADC_TRANSISTOR_DISABLE);  

    TSCADCStepIDTagConfig(TSC_ADC_INSTANCE, 1);

    /* Disable Write Protection of Step Configuration regs*/

    TSCADCStepConfigProtectionDisable(TSC_ADC_INSTANCE);

    /* Configure step 1 for channel 1(AN0)*/

    StepConfigure(0, TSCADC_FIFO_0, TSCADC_POSITIVE_INP_CHANNEL1);

    /* Configure step 2 for channel 2(AN1)*/

    StepConfigure(1, TSCADC_FIFO_1, TSCADC_POSITIVE_INP_CHANNEL2);

    /* General purpose inputs */

    TSCADCTSModeConfig(TSC_ADC_INSTANCE, TSCADC_GENERAL_PURPOSE_MODE);

    /* Enable step 1 */

    TSCADCConfigureStepEnable(TSC_ADC_INSTANCE, 1, 1);

    /* Enable step 2 */

    TSCADCConfigureStepEnable(TSC_ADC_INSTANCE, 2, 1);

    /* Clear the status of all interrupts */

    CleanUpInterrupts();

    /* End of sequence interrupt is enable */

    TSCADCEventInterruptEnable(TSC_ADC_INSTANCE, TSCADC_END_OF_SEQUENCE_INT);

    /* Enable the TSC_ADC_SS module*/

    TSCADCModuleStateSet(TSC_ADC_INSTANCE, TSCADC_MODULE_ENABLE);

}

 

/* Configures the step */

void StepConfigure(unsigned int stepSel, unsigned int fifo, unsigned int positiveInpChannel)

{    

/* Configure ADC to Single ended operation mode */

    TSCADCTSStepOperationModeControl(TSC_ADC_INSTANCE, TSCADC_SINGLE_ENDED_OPER_MODE, stepSel);

    /* Configure step to select Channel, refernce voltages */

    TSCADCTSStepConfig(TSC_ADC_INSTANCE, stepSel, TSCADC_NEGATIVE_REF_VSSA,                     positiveInpChannel, TSCADC_NEGATIVE_INP_CHANNEL1, TSCADC_POSITIVE_REF_VDDA);

    /* XPPSW Pin is off, Which pull up the AN0 line*/ // <--- modified

    TSCADCTSStepAnalogSupplyConfig(TSC_ADC_INSTANCE, TSCADC_XPPSW_PIN_OFF, TSCADC_XNPSW_PIN_OFF, TSCADC_YPPSW_PIN_OFF, stepSel);

    /* XNNSW Pin is off, Which pull down the AN1 line*/ // <--- modified

    TSCADCTSStepAnalogGroundConfig(TSC_ADC_INSTANCE, TSCADC_XNNSW_PIN_OFF, TSCADC_YPNSW_PIN_OFF, TSCADC_YNNSW_PIN_OFF,  TSCADC_WPNSW_PIN_OFF, stepSel);

    /* select fifo 0 or 1*/

    TSCADCTSStepFIFOSelConfig(TSC_ADC_INSTANCE, stepSel, fifo);

    /* Configure ADC to one short mode */

    TSCADCTSStepModeConfig(TSC_ADC_INSTANCE, stepSel, TSCADC_ONE_SHOT_SOFTWARE_ENABLED);

}

~~~~

 

However, Low voltage is observed.

   - AIN0 is 400mV

   - AIN1 is 200mV

 

Best regards,

Chi


Viewing all articles
Browse latest Browse all 25965

Trending Articles