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.

CCS/TM4C123GH6PM: TM4C123GH6PM

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hi all,

     In TM4C123GH6PM (CCS ), i am using ADC0 module. By default, ADC sample speed is 1MSPS. My query is , how can i change the sample speed???...

Is there any API for changing the sample speed? (My requirement is change the speed as 128x sample) .

Please, give some suggestion.

Thanks in advance,

sankari.

   

  • The simple way to control the sample rate is to use a timer to trigger the ADC. You can see this in the TivaWare example: C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\adc_udma_pingpong

    Line 389 of the file adc_udma_pingpong.c configures ADC0 to be triggered by a timer. Line 437 of that files configures Timer0-A to with a frequency of 16KHz. To change that to 128Hz, change 16000 to 128.

        TimerLoadSet(TIMER0_BASE, TIMER_A, (SysCtlClockGet()/128) - 1);