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/TM4C1294NCPDT: ADC12 Clock Rate

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

I have reviewed the datasheet and documentation but struggled to find simple question: Based on setting I used, what is actual sample rate?

.....in TM4C_System_Main_PreBIOS

uINT32 ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);

....in TM4C_ADC12.c

//---------------------------------------------------Set ADC Clock 
//ADCClockConfigSet(ADC0_BASE, ADC_CLOCK_SRC_PIOSC | ADC_CLOCK_RATE_FULL, 1); //1MSPS
ADCClockConfigSet(ADC0_BASE, ADC_CLOCK_SRC_PLL | ADC_CLOCK_RATE_FULL, 30);

ADCHardwareOversampleConfigure(ADC0_BASE,16);

I have 6 channel ADC12 configured tied to HWI interface which transfer FIFO data into buffer and then post semaphore to display result, all of these are working fine. It is trigger on demand rather than driven by 

(1) Can you show me how to calculate the sample rate of the above setup or how long it takes before it finishes capture and invokes interrupts

(2) My guess it is connected to 120MHz clock source (from 16MHz XTAL). 

  • Hi Richard,

     The details can be found under the Module Clocking section in the ADC chapter of the datasheet. You will find additional details in the Driverlib User's guide. Below is the excerpt. Since you are providing 30 as the divider the sample frequency is 480MHz (the VCO from the PLL as you are using the System clock as the clock source) divided by 30 which is 16MHz. 

    Description:

    This function is used to configure the input clock to the ADC modules. The clock configuration

    is shared across ADC units so ui32Base must always be ADC0_BASE. The ui32Config value

    is logical OR of one of the ADC_CLOCK_RATE_ and one of the ADC_CLOCK_SRC_ values

    defined below. The ADC_CLOCK_SRC_ values determine the input clock for the ADC. Not

    all values are available on all devices so check the device data sheet to determine value configuration

    options. Regardless of the source, the final frequency for TM4C123x devices must

    be 16 MHz and for TM4C129x parts after dividing must be between 16 and 32 MHz.