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.
Hello Guys,
I am using the TM4C1294NCPDT part of the launchpad (EK-TM4C1294XL).
I am trying to sample an ADC at 1usec from a timer. My first step, is to actually get a timer to interrupt every 1usec.
I can get a timer to interrupt every 1usec without TI-RTOS, but not with it.
Without RTOS
code :
2477.non-rtos-timer.zip
Here is the logic anlyser output:
https://i.imgur.com/whzphub.png
With RTOS
Now if I use the exact same code (with a HWI now), but using RTOS. The output is not 1usec, but around 4usec.
code:
Here is the logic analyser output:
https://i.imgur.com/fRJAbVl.png
Even if I use the timer module on TI-RTOS, set to 1usec. The output is even worse. It works well at higher periods, like 100usec though
The code:7776.rtos-with-timer-module.zip
The logic anlyser output:
Hi Daniel,
The behavior you’re seeing is due to the larger interrupt latency that comes with an RTOS. As such, even when using the maximum clock frequency on the device (120 MHz), producing an interrupt every 1uS would require the system to interrupt every 120 cycles. As an estimate, the worst case interrupt latency for the TM4C123GH6PM device is 135 cycles. In this case it’s simply not possible to achieve that interrupt response time with dispatched interrupts.
Luckily there is an alternative to this situation by using zero latency interrupts, which bypass the scheduler. Note that when using these you may not call any SYS/BIOS API’s from within the Hwi itself.
Using this method you may create a zero latency timer Hwi, take your ADC reading and process the data in the context of a Task.
You can view other benchmarks such as interrupt latency in your TIRTOS BIOS installation.
EX. C:\ti\tirtos_tivac_2_16_00_03_eng\products\bios_6_45_01_25_eng\packages\ti\sysbios\benchmarks\doc-files
and looking at the benchmarks.html page.
In addition to the benchmarks you may also view the API documentation in your installation.
EX. C:\ti\tirtos_tivac_2_16_00_03_eng\products\bios_6_45_01_25_eng\docs
and looking at the Bios_APIs.html page.
From the API Documentation you may view the m3 Hwi module (ti.sysbios.family.arm.m3.Hwi) which contains the details necessary to change your application.
Best,
Alexander