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.

RTOS: Integrating ADC in EtherCAT application

Other Parts Discussed in Thread: AM3359

Tool/software: TI-RTOS

Hi,

I am using AM3359 ICE v2.1A + SDK - ti-RTOS + PRU-ICSS-EtherCAT_Slave_01.00.05.00. and example ethercat application.

I am planning to read the temp sensor value and send it back to the master via ethercat.

I found a few adc examples in the SDK but was wondering which one to take as a reference? Is there an example adc application available specific for AM335x?

  • The RTOS team have been notified. They will respond here.
  • Dijo,

    There isn't an example for the AM335x ICEv2 ADC in the Processor SDK RTOS package in the MyexampleProjects directory.
    However, there is a diagnostics example at C:\ti\pdk_am335x_1_0_9\packages\ti\board\diag\adc which could be ported to the ICEv2.
    Hope this reference helps you.

    Lali
  • Hi,

    I tried to port the above example from pdk_am335x_1_0_8 to etherCAT example application.

    But while configuring ADC clock an execption occurred.

    TSCADCClkDivConfig (pCfgAdc->instAddr, pCfgAdc->modClk, pCfgAdc->afeInClk);

    parameters given:-

    /* Macro representing the module clock of TSCADC. */
    #define TSCADC_MODULE_CLOCK (24000000U)

    /* Macro representing the AFE clock of TSCADC. */
    #define TSCADC_AFE_CLOCK (3000000U)

    /* Macro representing the base address of TSCADC module. */
    #define TSCADC_BASE_ADDR (0x44E0D000U)

    I am attaching screenshots of CCS disassembly.

  • Hi,

    TSCADCClkDivConfig() is a function implemneted in tsc_adc_ss.c, it does a simple math division, then write the results into a register using HW_WR_FIELD32====>HW_WR_FIELD32_RAW. This is a common routine used by many functions. How this caused an exception? Read the value of address r3 into r3?

    Regards, Eric