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.

Compiler/EK-TM4C123GXL: TI-RTOS ADC driver

Part Number: EK-TM4C123GXL

Tool/software: TI C/C++ Compiler

Hello all, 

I am currently trying to use the pin B5 as an ADC input for a thermal sensor. I am working with ti-RTOS, so I think I understand that the driverlib API can't be used with it, because it can generates conflicts.

However I tried to use it in a task because I read it might be possible... and my program crash. 

I tried with the adc example code from launchpad workshop too but it crashed as well.

Do you have any solution ? 

Does an ADC driver for ti-Rtos exists ? 

Thank you for your help ! 

Best regards, 

Elisabeth

  • Greetings,

    Tixier Elisabeth said:

    ... and my program crash.    I tried with the adc example code from launchpad workshop too but it crashed as well. 

    Your report of, "crash" does not provide adequate detail.     Crash may mean different things to different people - thus is 'too vague' to be of (much) value.

    Instead:

    • did your program vector off into one of the "Fault ISRs?"
    • if so - which one?
    • had you enabled (both) the ADC Module and the GPIO Port which contained that ADC pin?
    • is pin B5 a 'proper' ADC capable one?     (the ADC section of the MCU manual lists those pins w/ADC capability)

    Such detail should better enable vendor agents and/or others to resolve your issue...

  • Tixier,

    We do not have a RTOS-aware ADC driver in TI-RTOS for TivaC. You have few options:

    1. Use driverlib calls. Make sure you use the Hwi module instead of plugging/managing the vector table directly with a IntRegister type of call. See https://e2e.ti.com/support/microcontrollers/other/f/908/t/849627 for more details about this.

    2. Look at the ADC driver in the SimpleLink MSP432E4 SDK. The MSP432E4 ADC peripheral is the same on both devices. You can use the ADC driver in the SimpleLink MSP432E4 SDK as a model to make your own ADC driver.

    Additionally is a write-up that hopefully can help you debug a crash: https://training.ti.com/debugging-common-application-issues-ti-rtos

    Todd

  • Hi Todd, 

    Thank you for your answer ! 

    I have to work on an other subject for a while now, but I will test this as soon as possible. 

    Using driverlib seems more simple than making a new driver, I think I take this option.

    Best regards, 

    Elisabeth