Hello,
I've used the GP 64 Bit Timer for timing measurements and run into several problems. Having found these two threads (which are unfortunately not answered yet; http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/177732.aspx & http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/180641.aspx), I got the same problems.
Device is a C6678, code example can be seen below (simple set up a timer, trigger an interrupt on Core 0 and measure time until IRQ is entered on Core 1). Testing this I run into following problems:
1) starting the timer just after the reset, I only get a time stamp on the first read; I suppose (low value is very high) on the second read the timer has timed out allthough the period is set to maximum and the timer is set to continous.
2) Starting the timer after open and called "Reset" before triggering the Interrupt just stops the timer and don't reset the counter. Moreover I always got a value in the Low-Register, the High is always 0. Why?
3) To avoid the two problems above, I just start the timer before triggering the Interrupt. The I got the following values: Timer start at 88462901 (Core 0), Timer stop at 88462593 (Core 1). I thought this is timer with the same time stamp on each core. How can the stamp reaching the IRQ be less than the stamp before triggering the interrupt???
4) Calculating the time: timer is running with 1/6 core frequency, which is 166.67 in my example (core runs with 1000 MHz). Cycle difference is 308 -> Time is Cycles / Clock => 308 / (166,67 x 10^6) = 1,85 / 10^6 = 1,85 micro seconds??? Such a long time for triggering a interrupt? Maybe there's something wrong in my calculation or the time stamps are wrong.
Hope somebody can help me on this issues.
Best Regards,
Bernd
--- Core 0 & 1---
memset(&TmrObject, 0, sizeof(TmrObject));
TmrHandle = CSL_tmrOpen(&TmrObject, 7, NULL, &CSLStatus);
if(TmrHandle == NULL)
{
Log_print0(Diags_USER1, "Timer_setup failed");
exitFailure(0);
}
TmrHwSetup.tmrTimerMode = CSL_TMR_TIMMODE_GPT;
TmrHwSetup.tmrTimerPeriodLo = 0xffffffff;
TmrHwSetup.tmrTimerPeriodHi = 0xffffffff;
CSL_tmrHwSetup(TmrHandle, &TmrHwSetup);
CSL_TmrReset64(TmrHandle);
--- Core 0 ---
CSL_tmrGetTimLoCount(TmrHandle, &uiCountLowStart);
Log_print1(Diags_USER1, "Timer Low Start: %d\n", uiCountLowStart);
volatile uint32_t *uiptr_register = (uint32_t *) 0x02620240;
uiptr_register += 1;
*uiptr_register |= (1 << 4); // set source
*uiptr_register |= 1; // interrupt
--- Core 1 ---
void IRQ_test(UArg arg)
{
if(DNUM == 1)
{
CSL_tmrGetTimLoCount(TmrHandle, &uiCountLowStop);
Log_print1(Diags_USER1, "Timer Low Stop: %d\n", uiCountLowStop);
}
}