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.

Software Timers in DSP/BIOS

All:

I am using DSP/BIOS 5.42 on C55x. I have a situation where I need to wait a prescribed amount of time (mostly during initialization of external parts).

Presently to do these, we have "for loops" for various lengths of time. However, I would like to be able to set up a "software timer" to do a similar thing. I have seen this feature on other RTOS's, but I do not see a similar feature here.

For instance, there are times when I am initializing an external part, where I need to wait a fixed amount of time between sending SPI commands. Also, there is another fixed amount of time for the part to be ready to take commands.

There may also be necessary delays during run-time of the product.

Is there existing code to do this?

Delays can be in the microsecond, millisecond, seconds range.

  • An example of such a delay function is in embOS and PowerPAC RTOS's - called OS_Delayus( ) has passed parameter of us with a range of 1 to 32767.

     

  • Hi Todd,

    In DSP/BIOS we have an API TSK_sleep(nticks) that delays the current task's execution by nticks clock ticks. This API can only be called from a task context. You can read more about this API from the C55x DSP/BIOS API reference guide - http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dspbios/5_41_00_06/exports/docs/docs/spru404p.pdf

    Best,

    Ashish

  • Thanks for the reply. I will probably continue to use the "for loop" approach and make sure that it is tuned for the speed of the processor. For longer times, it would be good to have a mechanism that would be able to update properly in the presence of interrupts, but that might be better suited by designing the task for that mechanism. I am being a bit vague, because right now I do not know of a runtime delay that I need to worry about, mostly initialization delays associated with the external parts that are connected to the DSP.