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/EK-TM4C1294XL: ADC conversion never completing in single_ended.c TivaWare example

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Hello folks,

As the title suggests, I have yet to have this example actually return a sample value given that the code never gets past:

        //
        // Wait for conversion to be completed.
        //
       while(!ADCIntStatus(ADC0_BASE, 3, false))
        {
        }

within the while loop and this is just prior to obtaining the sequence.

Only changes I have made in trying to remedy this to no avail were ensuring the use of the internal reference:

ADCReferenceSet(ADC0_BASE, ADC_REF_INT);

And then making certain the master osc was used vs the PLL

ADCClockConfigSet(ADC0_BASE, ADC_CLOCK_SRC_MOSC, ADC_CLOCK_RATE_FULL);

Other than this, nothing else was touched and I'm out of ideas on why it never leaves the interrupt status check function above, any ideas...?

Thanks,

b

  • Just saw this post, which addresses and resolves the exact issue, but it is not titled as such:

    e2e.ti.com/.../1463179

  • I suspect that your problem may be similar. When you use the generic peripheral examples in "C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripherals" you must be careful to setup the project for the correct device. I do this by importing the "project0" for the board/device you are using. In this case, I started by importing project0 from "C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\project0".

    Then I renamed the project "ADC_single-ended" and deleted the file project0.c from the project. Then I copied the files "C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripherals\adc\single-ended.c" and "C:\ti\TivaWare_C_Series-2.1.4.178\utils\uartstdio.c" into the project. This compiled and ran.

    I suspect that what happened is that you did not have the correct device defined in your project and it tried to use the wrong clock setup function.

    On the TM4C129 device you must use SysCtlClockFreqSet(), not SysCtlClockSet().

    I have exported my project and attached it:

    /cfs-file/__key/communityserver-discussions-components-files/908/ADC_5F00_single_2D00_ended.zip

  • May I applaud your direction to, "speed, ease, enhance" project development via the (repeated) use of "project0?"

    Does so much to insure, "User Success" - today's IDEs are highly complex beasts - and "REUSE" of a "known good" imported technique (which effectively & properly manages most ALL configurations/set-ups) surely reduces/prevents the unending, "Created my Own Project" disasters!

    Note that firm/I employ this exact method (although not project0) under IAR...   Simplicity and "known good" (config & set-up) RULE!

  • Excellent, love it! The UART is even in full effect, which is next on my to-do list.