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.

DSP/BIOS CLK Module doesn't work properly.



 Hello. I'm using the DSK6555 with TMS 1,2GHz.

I have a problem with an understanding functions using the timer and time characteristics

My test dsp applications using the dsp/bios configuration bellow

utils.loadPlatform("ti.platforms.dsk6455");

/* The following DSP/BIOS Features are enabled.  */
bios.enableMemoryHeaps(prog);
bios.enableRealTimeAnalysis(prog);
bios.enableRtdx(prog);
bios.enableTskManager(prog);
bios.GBL.CLKOUT = 1200.0000;
bios.MEM.instance("IRAM").createHeap = 1;
bios.MEM.instance("DDR2").createHeap = 1;
bios.MEM.BIOSOBJSEG = prog.get("IRAM");
bios.MEM.MALLOCSEG = prog.get("IRAM");
bios.TSK.create("MyTask");
bios.TSK.instance("MyTask").order = 2;
bios.TSK.instance("MyTask").fxn = prog.extern("myTask");
// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

prog.gen();

 

Values of some time functions:

CLK_countspms(); //1200000

CLK_getprd();// 1199994

this pair corresponds each other, on one low timer tick i have about 1200000 high timer ticks

CLK_cpuCyclesPerHtime();// 1.0

CLK_cpuCyclesPerLtime(); //199999.000000

This pair doesn't corresponds each other. See upper.

GBL_getClkIn(); //199999.00000

GBL_getFrequency();//199999.000035

I don't understand this values

TSK_sleep(100) - sleeps by 100ms and the high resolution timer value increases by 120 000 000, the low resolution timer value increases by 100

 

Function descriptions:

1. CLK_countspms(); //High resolution timer ticks in the ms. It's works properly (but tonight only, yesterday TSK_sleep() waited much longer time)

2. CLK_getprd(); //High resolution timer ticks in the low resolution timer ticks. (Example calulating abs time is right)

timeAbs = (CLK_getltime() * CLK_getprd()) / CLK_countspms();

3. CLK_cpuCyclesPerHtime(); Use doc example

time1 = CLK_gethtime();
... processing ...
time2 = CLK_gethtime();
CPUcycles = (time2 - time1) * CLK_cpuCyclesPerHtime(); // = 120 000 000 * 1
/* calculate absolute time in milliseconds */
TimeAbsolute = CPUCycles / GBL_getFrequency(); //120 000 000 / 200 000 = 600 ms (real value is 100 ms) ????

4. CLK_cpuCyclesPerLtime(); //see CLK_cpuCyclesPerHtime(). It also works wrong.

 

 

Thanks.