AnsweredAssumed Answered

Time_Delay tick duration error

Question asked by David XY Zhou on Sep 1, 2016
Latest reply on Sep 2, 2016 by Daniel Chen

Hi,

I have K60 Tower board: _K60P144M150SF3RM. CodeWarrior Version 10.6.4. MQX 4.2

 

I found that the system timer tick has a big deviation. For example:

 

In a task with priority 4 as highest in the project. In the task, just loop a counter with _time_delay(10):

void CAN_Task(uint32_t initial_data) {
volatile int iCanTaskCount = 0;   
while (1) {
_time_delay(10);     //it seems that one cylce = 14.93 ms time, or 1 tick = 1.493 ms
iTaskCount++;
PRINT_MSG("%x: %d\r\n", iTaskCount);
}

//RESULT:

FOR 60SECONDS time duration, iTaskCount= 4018.

If the timer is accurrate, then the output of the iTaskCount shall be 6000.

That is huge error. Is it a software issue, or the system oscillator has error? 

 

Thank you,

David Zhou

Outcomes