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.

sysbios timer mapping

Other Parts Discussed in Thread: SYSBIOS

I want to use a sysbios timer to provide a periodic call to a function, from which I will post a semaphore to awaken a thread that needs to execute every 20ms.  All this seems quite reasonable, but I need to avoid certain physical timers that are being used in the (Tiva TM4C1231) system for PWMs.

Is it possible to tell what timer will be allocated for a give sysbios timer number?  Or failing that, can I instruct sysbios to avoid some timers?

  • The Timer_create() API uses "Timer_ANY" to return any timer if the user doesn't care which timer he gets.  

    You can tell SYS/BIOS which lm4 timers are reserved from the ANY set using the following in your .cfg script.

    Timer = xdc.useModule('ti.sysbios.family.arm.lm4.Timer');
    Timer.anyMask = 0x3;  // reserve all timers for "other" users except for timer 0 and timer 1.


    The Clock module uses a Timer internally.  By default, the Clock module calls Timer_create() with "ANY" which will return one of the available timers.  You can specify the exact timer using the following (the default value for Clock.timerId is ANY).

    Clock= xdc.useModule('ti.sysbios.knl.Clock');

    Clock.timerId = 3;

    If you are using Timer directly, you can specify a Timer id in the Timer_create() API.   

  • Thanks for the information.  I probably didn't make my own setup clear enough, and I may simply misunderstand the details of the tools that I'm using.

    I've been using the GUI (Sys/Bios, Timers, Add).  I saw the timer numbers in the selection, but I had the impression that these were logical numbers rather than physical timer numbers.  I thought that there was some per device mapping of these numbers to actual timers.  But if they are physical timer numbers, then the problem was all in my head.  I could just specify the one that I wanted.  Is this the case?

  • For the Tiva parts, the logical timer IDs map one-to-one with the physical timer IDs.

    So, yes, you should be able to simply specify the one you want.

    Alan