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.

AM5729: Is it possible to set TI RTOS clock tick in microsecond range?

Part Number: AM5729
Other Parts Discussed in Thread: SYSBIOS

Hello,

I have an application requirement that needs a timer/clock interrupt periodically every 20 microseconds. 

I understand that the default clock tick for the TI RTOS is set at 1 ms. But when I try to change the clock tick to 20 microseconds, it looks like the RTOS can do no other work due to the repeated interrupts coming up so quickly.

Is there any way to fulfil this requirement of 20 microsecond interrupt while using TI RTOS?

Thanks,

Dimple

  • Hi,

    What are the duty cycles in each 20us window? Does the application have to finish each process in 20us? Can it be accumulated into patch processing?

    Are you using PRD to setup 20us task or just ISR with interrupt every 20us?

  • Hi Stanley,

    Thanks for your reply.

    Yes, the application has to carry out the processing within 20us. The flow is as follows:- Once there is a 20us interrupt, the ISR handles the interrupt and the task that carries out the processing is activated. This processing should be completed within 20us. Then same flow keeps repeating. This implies, I need a minimum time spent inside the ISR. 

    I have tried different methods to achieve this - 

    1. Used the clock function - With this method, I have to set the clock tick to 20us and the application doesn't work (apparently doesn't come out of the dispatcher itself). The interrupt handler in this case is the clock module callback function.

    2. Used RTOS timer - This method works, but the time the ISR spends in the ISR is very high (2-3 us) even though it essentially just involves posting a semaphore for activating a task. The interrupt handler here is the callback function while setting up the RTOS timer.

    3. Initialized a timer using CSL and used the hwi module for its interrupt. This also takes up a lot of time in the ISR (2-3 us). The interrupt handler here is the hwi callback function.

    The time taken in the ISR, i.e. 2-3 us is very high when compared relatively with 20us. Since the application needs most of this time for processing, it is not reasonable to take up 2-3 us just for a semaphore post. 

    Is there any data on how much minimum time the RTOS scheduler takes in different cases like the ISR, task switch, hwis, swis etc. on a C66x processor? 

    Also, I am not sure what you mean by PRD. Could you please expand on that? 

    Thanks,

    Dimple

  • Hi Dimple,

    You can find the benchmark data in SYSBIOS documentation.

    Did you put ISR code in DSP L2 SRAM? If it is in DDR, the cache operation can be costly.

    You can configure most of L2 SRAM as SRAM (up to 288KB) instead of L2 Cache and try to fit the code/data required for the tight loop to improve the performance.

    Regards,
    Stanley

  • Hi Stanley,

    Thanks for the pointer, I will try that out.

    Regards,

    Dimple