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: Can anyone share ADC sample code: use 1 GPIO pin to read the input?

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

I am new to CCStudio v7. I am working on a project that requires ADC. I tried to search for ADC sample codes but I can only find the codes work for older version CCS. I want to initialize a pin to sample analog input. The sampling rate is as fast as possible. And resolution is as high as possible. 

Simply, I just want a basic function which is similar to AnalogRead() on Arduino IDE. 

Can anyone share the code?

Thanks in advance!

  • Tom,
    Look for the TivaWare library at www.ti.com/tivaware.
    Install that in your computer, and go to the /docs folder, where you will see a User Guide with all the functions - there's a whole chapter for ADC.
    Then, you will find examples folders, in which there are a few ADC full working examples.
    Regards
    Bruno
  • Might we note too - that novice poster, "Kicks KISS FAR to the curb" - seeks ONLY Highest Speed Sampling & Highest Resolution - via "donated (effort-lite) code" - and all this in one (described as "simple") GO! 

    Minus a reasonable understanding of the MCU's ADC - and its "care/handling via signal introduction" - is (even) the  near achievement of either goal - at all likely?

    Is it (ever) that poster requests should attempt to, "meet reality?"      Are poster's provided the "best guidance" when their "stated desire" has yet to reach their capability & understanding level?