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.

Semaphore_Pend timeout in SYS/BIOS v6

hello everyone, i'm using CCS v5 and OMAP L138.

I have two questions ?

Q1 : i am using semaphore_pend(Sem,timeout)  to pend task till Sem is post or timeout . the problem is as follows

i want to use  timeout = 100 micro sec and clock module working with 1000us (=1ms) and if i change it to be 1us the bios scheduler never started.

so could anyone tell me how to use semaphore_pend with timeout in micro sec ?

Q2 : is there  function like(USTIMER_delay) but takes delay period in nano sec ?  

Thanks in advance.

  • I'm afraid there is no easy way to achieve what you're trying to do. The current Clock module design uses a timer interrupt as its timebase.

    As you seem to have figured out, all SYS/BIOS timeouts are in units of Clock ticks.

    If the Clock tick period is 1ms, then a timeout of 1 translates to 1ms.

    As you discovered, setting

        Clock.tickPeriod = 1;

    would give you microsecond granularity in your timeout arguments, but would also require a timer to being configured to go off every 1us, which probably caused your CPU to get overwhelmed with interrupt servicing.

    To get 100us granularity, you could try setting:

        Clock.tickPeriod = 100;

    which translates to a timeout of '1' being 100us.

    But this also means that your CPU is being interrupted every 100us, which may be ok, but often IS NOT!

    Alan

  • Thanks Alan, you confirmed what i had expected. 

    Thank you very much for your fast response.

    And if  you know  a complex way to do what i want , i will be very grateful to know from you.