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.

RTOS/AM5716: SYSBIOS Timer Accuracy?

Part Number: AM5716
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi !!

I'm porting TI-RTOS to my custom board of AC5716 and using CCS8.3 with pdk_am57xx_1_0_12.

I need the timer interrupts every 1ms so I create SYSBIOS timer in *cfg file as below  and set period to 1000us.

When I measure it with an oscilloscope,  I got actually 950us.

What should I check?

Best Regards,

JY Koh

  • Please refer to the TI RTOS notes about configuring timers here:

    http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS:_TI_RTOS_Tips_And_Tricks#How_to_get_accurate_clock_ticks_from_the_clock_module.3F 

    For reference please look at  the pm_a5.cfg file in the PM LLD driver example located here:

    pdk_am437x_1_0_10\packages\ti\drv\pm\examples\pmrtos\pm_a15.cfg

    Syntax to configure timer and set the input clock correctly:

    /***********************************************
    * Timer Module Configuraion *
    ***********************************************/
    /* Assign GPTimer2 to be used for Timestamp */
    /* Set to 1-ms Tick and Enable Wakeup for OVF interrupt */
    var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    var timerParams = new Timer.Params();
    timerParams.period = 1000 * 10;
    timerParams.twer.ovf_wup_ena = 1;
    timerParams.tiocpCfg.emufree = 1;
    timerParams.tsicr.posted = 0;
    /* Timer ID = 1 for GPTimer2 and input clock runs at 20 MHz */
    Timer.intFreqs[1].hi = 0;
    Timer.intFreqs[1].lo = 20000000;
    Timer.create(1, '&mainTimerTick', timerParams);

    /* Assign GPTimer3 to be used for Timestamp */
    /* Timer ID = 2 for GPTimer3 and input clock runs at 20 MHz */
    var DMTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    var timerParams2 = new DMTimer.Params();
    timerParams2.tsicr.posted = 0;
    DMTimer.intFreqs[2].hi = 0;
    DMTimer.intFreqs[2].lo = 20000000;
    var DMTimestampProvider = xdc.useModule("ti.sysbios.timers.dmtimer.TimestampProvider");
    DMTimestampProvider.timerId = 2;
    DMTimestampProvider.useClockTimer = false;
    var Timestamp = xdc.useModule("xdc.runtime.Timestamp");
    Timestamp.SupportProxy = DMTimestampProvider;

    /* Indicate GPT2 & GPT3 are used */
    var TimerSupport = xdc.useModule('ti.sysbios.family.shared.vayu.TimerSupport');
    TimerSupport.availMask = 0x0006;

     

    
    

     

    Set the value highlighted in yellow to OSCIN that is input clock to DMtimer on the device.

    Hope this helps.

    Regards,

    Rahul