Hello all,
I have a project with FreeRTOS running on the TMS570 (MCBTMS570 dev board). I have a task that executes every 100 microseconds (10kHz rate). However when I calculate the time it takes to run this task it is in the order of 170us. Which would indicate that I'm not meeting the 100us schedule. This is perplexing because there are lower priority tasks that do get executed (meaning the 10kHz schedule is being met). Below is the method I employ to calculate the time to execute the task.
I make use of the Free Running Counter Register (FRC) to determine the amount of time it takes to run this task. The counter frequency (per HalCoGen) is 10MHz. This is the code:
// Read FRC register before executing go_10KHz(); FRC_dummy_reg1 = rtiREG1->CNT[0U].FRCx; // Do work... go_10KHz(); // Read FRC register post execution of go_10KHz() FRC_dummy_reg2 = rtiREG1->CNT[0U].FRCx; // Calculate time elapsed TimeElapsed = FRC_dummy_reg2 - FRC_dummy_reg1;
When the above code executes the TimeElapsed is in the order of 1700. 1700 ticks at 10Mhz = 170us.
How can I verify that the FRC ticks I count are indeed at 10MHz?
Thanks