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.

Compiler/TDA4VM: How to make clock_create using the kernal Clock to create SW Interrupts?

Part Number: TDA4VM
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI C/C++ Compiler

By default, the Clock module calls Timer_create() with "ANY" which will return one of the available timers.

If I want to use BIOS Clock_create() API to create SW Interrupts. It should be some configuration. This means I should configuration the clock module using the kernal clock? Could you show me how to configure it?

  • I didn't get your question. Clock_create() already creates SW Interrupts. You want to know how to configure the BIOS clock ? like for example tickPeriod ?

    Take a look at section 5.2 of the BIOS user guide

    Regards

    Vineet

  • 5.2 Clock
    The ti.sysbios.knl.Clock module is responsible for the periodic system tick that the kernel uses to keep
    track of time. All SYS/BIOS APIs that expect a timeout parameter interpret the timeout in terms of Clock
    ticks.
    The Clock module, by default, uses the ti.sysbios.hal.Timer module to create a timer to generate the
    system tick, which is basically a periodic call to Clock_tick(). See Section 5.3 for more about the Timer
    module.
    The Clock module can be configured not to use the timer with either of the following configuration
    statements:
    The period for the system tick is set by the configuration parameter Clock.tickPeriod. This is set in
    microseconds.
    The Clock_tick() and the tick period are used as follows:
    • If the tickSource is Clock.TickSource_TIMER (the default), Clock uses ti.sysbios.hal.Timer to
    create a timer to generate the system tick, which is basically a periodic call to Clock_tick(). Clock
    uses Clock.tickPeriod to create the timer. Clock.timerId can be changed to make Clock use a different
    timer.

    I have read the chapter5.2, It said if clock_create will use HW Timer by default.

    If I use this example below, if it means the clock.create will create SW Interrupt?

    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var clockParams = new Clock.Params();
    clockParams.period = 5;
    clockParams.startFlag = true;
    clockParams.arg = (UArg)0x5555;
    Program.global.clockInst1 = Clock.create("&myHandler1", 5, clockParams);

  • Yes, clock_create() uses the same HW Timer which is also used by BIOS for it's tick.

    Your code will create a SW interrupt.

    Regards

    Vineet