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.

ADC Drivers

Hi,

In TI-RTOS 2.12 User Guide, (Literature Number: SPRUHD4I), we have all drives like EMAC, GPIO, I2C etc but we don't have any drivers for ADC.

Does TI-RTOS does not have ADC drivers?

Regards

Srinivasa

  • Tried to look for some examples under:

    Code composer studio->TI-RTOS->ARM->Tiva C Series->Tiva TM4C129X Evaluation Kit-> Target Examples

    There are no ADC examples also.

    Do you have any examples for ADC module (interrupt and polling mode)?

    Regards
    Srinivasa
  • TI-RTOS does not provide drivers for ADC.

    However, I believe you can find an API set for ADC in TivaWare, which ships with TI-RTOS.

    You can find TivaWare under your TI-RTOS installation, within the "products" folder.  You can also download it from here.

    Steve

  • Are the ADC drivers thread safe, because I have read in one of the documents (which one i have forgotten) that Tivaware is not thread safe and cannot be used in task context. correct me I am wrong

    Narendra
  • As mentioned above TI does not have any ADC drivers so there is no question of thread safe for ADC drivers.

    Regards

    Srinivas

  • Hi Narendra,

    My colleague just informed me that he's filed an enhancement request for adding an ADC driver into TI-RTOS:

    SDOCM00117539: Add an ADC driver into TI-RTOS

    Steve
  • By when it will be available?

    Srinivasa
  • I can't possibly give you an accurate estimate at this time, as the enhancement request was just filed today. The request will be analyzed by the TI-RTOS team and then scheduled into a future release.

    Steve
  • Steve, Any Updates on ADC drivers on TI-RTOS?

    Thanks and Regards
    Narendra
  • Narenda,

    As Steve mentioned in an earlier post, he filed this enhancement request for TI-RTOS on your behalf but it has not been committed to any particular release. At this point given the backlog of other work, I don't anticipate that one would be released this year.

    To address your question in the short term, Steve's original response of pointing you to the TivaWare software library is probably your best option. With regard to the question of thread safety, I believe that you can use all of the DriverLib functions from task context. What is not safe is to have multiple tasks manipulating the same peripheral hardware via TivaWare's DriverLib concurrently.

    For example, a single task using the ADC module from TivaWare DriverLib is fine -- for example, the programming example in section 4.3 of the TivaWare User's Guide (shown below) should work. If you have further questions about TivaWare and how best to leverage it, I encourage you to post your questions to the TM4C Microcontrollers Forum for the experts there to answer.



    4.3 Programming Example
    The following example shows how to use the ADC API to initialize a sample sequencer for processor
    triggering, trigger the sample sequence, and then read back the data when it is ready.

    uint32_t ui32Value;
    //
    // Enable the first sample sequencer to capture the value of channel 0 when
    // the processor trigger occurs.
    //
    ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 0,
    ADC_CTL_IE | ADC_CTL_END | ADC_CTL_CH0);
    ADCSequenceEnable(ADC0_BASE, 0);
    //
    // Trigger the sample sequence.
    //
    ADCProcessorTrigger(ADC0_BASE, 0);
    //
    // Wait until the sample sequence has completed.
    //
    while(!ADCIntStatus(ADC0_BASE, 0, false))
    {
    }
    //
    // Read the value from the ADC.
    //
    ADCSequenceDataGet(ADC0_BASE, 0, &ui32Value);
  • Thanks for Info,David. We have already started using the Tivaware ADC drivers for out project.

    Thanks
    Narendra