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.

RTOS: CC2640 trigger ADC conversion in ISR

Other Parts Discussed in Thread: CC2640R2F

Tool/software: TI-RTOS

Hi,

I am working on a custom PCB using the CC2640R2F using TIRTOS version 2.20 and the TI drivers for the peripherals. I need to trigger an ADC conversion on an interrupt, but I can't find an appropriate interface in the ADC or ADCBuf drivers. 

My first attempt was to use the ADC driver, but the ADC_convert() call is blocking, so it doesn't work.

I also tried to use the ADCBuf driver, I set it up to collect a single sample in callback mode. When I call ADCBuf_convert() in my ISR I do land in the specified callback function (which is only a return statement), but after it leaves the ISR the program gets stuck. without the ADCBuf_convert() call the program runs as expected. 

I have considered putting the ADC in a separate task pending on a semaphore that I can post in the ISR, but I would like to avoid it due to the ram usage and context switching overhead. Is there a way to trigger and ADC conversion from an ISR?

Kind regards,

Lukas