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

Tool/software: Code Composer Studio

hi

I am trying to integrate an ADXL1001( accelerometer )  sensor with my TM4C123G and i want to get the values of the sensor in a text file.I am getting some values on Port E but im not sure about the sampling rate. Now im having issues with the sampling rate of the ADC. can anyone help me with finding the default sampling rate of ADC in TM4C123g and then resetting it to our desired value. i need more than 20k sampling rate.

  • Hello Samama,

    Have you looked at the TivaWare provided ADC examples such as single_ended.c found at [Install Path]TivaWare_C_Series-2.1.4.178\examples\peripherals\adc?

    There isn't a default sample rate, you define that as you setup your ADC. How much more than 20kHz rate do you need? 20kHz is very easy for the device to do.
  • yeah we are following the same example and we want it to get 40k,(does it means we are going to get 40k samples per second?), plus how can we set up our ADC to get 40k samples in a second? is there any function call/ API for setting up the ADC to the required sampling rate? for now we are just getting 10-15 samples in one sec .

  • Hello Samama,

    Okay that helps me understand where you are at right now. For that example, the ADC conversion is triggered in the application code by the ADCProcessorTrigger(ADC0_BASE, 3); API call.

    So you can adjust the sample rate by adjusting the delay at the end of the while loop.

    For practical applications, you would trigger the ADC via a timer interrupt, and control the sample rate based on the timer.

    Does that help explain what you can do better?

    If you don't mind a complex example that also uses the DMA, I can provide a sample project that has a timer trigger, but if you are just learning it may be a bit overwhelming. Let me know.
  • thankyou so much,Sir. 

    that'd be so kind of you if you could provide me with the DMA example.

    Regards

  • Hello Samama,

    Certainly, here you go! - 1856.ADCwDMA.zip