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.

AM3359: OSAL_TEST_TIMER period

Part Number: AM3359

Hi community member,

I have a favor to ask you.

Why is "OSAL_TEST_TIMER_PERIOD" 726000?
Please tell me the calculation method.

File : ...ti\pdk_am335x_1_0_14\packages\ti\board\diag\usb_host\src\TIMER.c

#if defined(SOC_AM335x)
#define CM_PER_TIMER3_CLKCTRL             (0x44e00084)
#define CM_DPLL_CLKSEL_TIMER3_CLK         (0x44e0050c)
UT_Timer_Type_t  timer_type    =          UT_Timer_DMTIMER;
#define OSAL_TEST_TIMER_ID                (1U)
#define OSAL_TEST_TIMER_PERIOD            (726000U)

Best regards,
Cruijff

  • Hi Cruijff,

    OSAL_TEST_TIMER_PERIOD is the system ticks you wish to set for the timer. By default it is micro-second. In this case, 726000 means 726ms. Of course, you can change the basic unit for the timer by setting the timerParams.periodType. By default it is TimerP_PeriodType_MICROSECS

    Ming

  • Hi Ming,

    Thank you for your reply!

    Sorry, I have one more thing to ask.

    What is the timer interrupt cycle in the sample of the following sample?

    • ...ti\pdk_am335x_1_0_14\packages\ti\transport\ndk\nimu\example\CCLink\cclink_slave\sample

    What is the clock source and cycle supplied to the timer?

    My customer built and tested the sample project of CCLink_SLAVE.
    As actual measurement, the timer interrupt cycle was 1 ms.
    I want to know the factor that generates the 1ms cycle from the setting of 726000.

    Best regards.
    Cruijff

  • Hi Cruijff,

    From the source code, it looks like the timer was created as TimerP_PeriodType_MICROSECS, so it should interrupt once per 726ms.

    You can always use the following APIs to get details about this timer:

    Timer_getFreq()

    Timer_getCount()

    Ming