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.

OMAP-L137 timer

Other Parts Discussed in Thread: OMAP-L137, SYSBIOS

Hello,

I've a couple of questions related to the timers on the OMAP-L137.
On the ARM side of the OMAP the following version are used:
- BIOS Version: bios_6_20_01_41
- CCS Version : 4.0.1.01001

In our application the ARM and the DSP are sharing the lower part (Half_LOWER) of Timer1, the upper part is not used and the Timer0 is used solely by the DSP.
The ARM configuration currently only contains a clock module which is used for Timer1 settings (ti_sysbios_knl_Clock.timerId = 1;).
The correct value for PRD12 register of Timer1 must be 0x61A8 (25000), which is
the value the DSP configures. However, when loading/running an ARM image after
the DSP has set PRD12, this PRD12 register is overwritten by the ARM with 0x5DC0 (24000). This seems to be the default value and is derived from Timer_module->intFreq (24MHz), found in the function Timer_getFreq() of Timer.c.
When including the ti.sysbios.timers.timer64.Timer module in the configuration,
I'm able to set the intFreq to 25MHz (ti_sysbios_timers_timer64_Timer.intFreq.lo = 25000000;)
Q1: Is this the only/correct way to set the intFreq value to 25MHz?

Another problem I oberved is, that the ARM will stop the lower part of Timer1
(calling Timer_stop() in BIOS) whenever the ARM is booting and this affects
the DSP.
Q2: Is there a way to bypass the call to Timer_stop()?

I'm thinking about the usage of the upper part of Timer1 for the ARM by setting
ti_sysbios_timers_timer64_Timer.defaultHalf = ti_sysbios_timers_timer64_Timer.Half_UPPER;
Q3: Is in this case excluded that the ARM affects the DSP timer (Timer0 and lower half of Timer1)?
Q4: Is the ARM then only using the upper part of Timer1 (e.g. for the clock module)?

According the Timer User's Guide (sprufm5a.pdf) the upper half ot the Timer
(Timer 3:4) operates as a 32-bit timer being clocked by a 4-bit prescaler in unchained mode.
Q5: How does Timer 3:4 behave when setting TDDR34 and PSC34 of TGCR to 0?
Q6: Is the behavior the same as Timer 1:2, i.e. without prescaler?

Thanks,
Frank

  • Frank Aschenbrenner said:

    I'm able to set the intFreq to 25MHz (ti_sysbios_timers_timer64_Timer.intFreq.lo = 25000000;)
    Q1: Is this the only/correct way to set the intFreq value to 25MHz?

    You can also change the timer frequency at runtime using the "Timer_reconfig()" API.

    Frank Aschenbrenner said:

    Another problem I oberved is, that the ARM will stop the lower part of Timer1
    (calling Timer_stop() in BIOS) whenever the ARM is booting and this affects
    the DSP.
    Q2: Is there a way to bypass the call to Timer_stop()?

    Not currently.  One option is for you to disable the Clock module's internal use of the Timer and program the timer externally.  You can set the Clock modules tick source to "user".  After doing this, you can program the timer (or use the timer64.Timer APIs) to program one of the timers and then have the timer ISR call Clock_tick() to increment BIOS's time.  Also note that the Clock module is optional and if your application does not need timeouts (you don't call Task_sleep() or Semaphore_pend() or other APIs with a timeout), then you can disable the Clock entirely (set BIOS.clockEnabled = false in your .cfg).  If you want better control of the timer and also to share same timer on both Arm and DSP for BIOS clock tick, it may make sense to program timer on one of the cores, and then just connect the interrupt line on the other core.   In this way, you would only use 1/2 of one timer to generate interrupt pulse to both cores.   You can look at the source code in Clock.c and Timer.c to see examples of Timer use.  Another option is to have both CPUs use same half of same timer.  Both will program it with same values and both cores and both cores will get interrupt.

    Frank Aschenbrenner said:

    I'm thinking about the usage of the upper part of Timer1 for the ARM by setting
    ti_sysbios_timers_timer64_Timer.defaultHalf = ti_sysbios_timers_timer64_Timer.Half_UPPER;
    Q3: Is in this case excluded that the ARM affects the DSP timer (Timer0 and lower half of Timer1)?
    Q4: Is the ARM then only using the upper part of Timer1 (e.g. for the clock module)?

    According the Timer User's Guide (sprufm5a.pdf) the upper half ot the Timer
    (Timer 3:4) operates as a 32-bit timer being clocked by a 4-bit prescaler in unchained mode.
    Q5: How does Timer 3:4 behave when setting TDDR34 and PSC34 of TGCR to 0?
    Q6: Is the behavior the same as Timer 1:2, i.e. without prescaler?

    I need to do some research on this tomorrow and will get back to you.

    -Karl-

     

     

  • Karl,

    thanks.

    Did you find time to do some research on my other questions?

     

    Frank

  • Frank Aschenbrenner said:

    I'm thinking about the usage of the upper part of Timer1 for the ARM by setting
    ti_sysbios_timers_timer64_Timer.defaultHalf = ti_sysbios_timers_timer64_Timer.Half_UPPER;
    Q3: Is in this case excluded that the ARM affects the DSP timer (Timer0 and lower half of Timer1)?
    Q4: Is the ARM then only using the upper part of Timer1 (e.g. for the clock module)?

    According the Timer User's Guide (sprufm5a.pdf) the upper half ot the Timer
    (Timer 3:4) operates as a 32-bit timer being clocked by a 4-bit prescaler in unchained mode.
    Q5: How does Timer 3:4 behave when setting TDDR34 and PSC34 of TGCR to 0?
    Q6: Is the behavior the same as Timer 1:2, i.e. without prescaler?

    Sorry for the delay.

    A3:  Yes.  The Timer module is careful to only touch the registers associated with a specific half of the timer (in unchained mode).
    A4:  Yes.  The Arm is only using upper half of timer1.

    A5/A6:  If TDDR34 and PSC34 are '0', then the Timer3:4 behaves same as Timer1:2.  When using top-half of timer, we set these bits to 0 by default in the BIOS timer driver.

    I just did some experiments here on evmOMAPL138 (not OMAPL137, but should be same) and was able to share timer0 between Arm and DSP and set different timer frequency for low and high timers for each core respectively.   I did this with the following configuration code.

    // Arm .cfg file

    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
    Timer.defaultHalf = Timer.Half_UPPER;

    Clock.timerId = 0;
    Clock.tickPeriod = 100;   // 100us tick period

     

    // DSP .cfg file:

    var Timer = xdc.useModule('ti.sysbios.timers.timer64.Timer');
    Timer.defaultHalf = Timer.Half_LOWER;

    Clock.timerId = 0;
    Clock.tickPeriod = 1000;   // 1000us tick period

     

     

     

    Regards,
    -Karl-

     

     

  • Karl,

    thanks a lot!

     

    Kind regards,

    Frank