Hi all,
I'm working on C6678 with TMDSEVM6678LE Evaluation Module.
I'm trying to use a ISR function (by a timer module instance) in order to create an interrupt every 100us and I'm using a CPU clock frequency = 1 GHz.
To check the effective interrupt period I toggle a GPIO and I view it on an oscilloscope.
If I use a CPU clock frequency = 1 GHz the effective interrupt time is 100us, but if I want to increase the CPU clock frequency (e.g. from 1 GHz to 1,25GHz), increasing the performance, the time interrupt changes as well (from 100us to 125us) in contradiction to my expectations.
In fact, in my understanding I suppose that the timer frequency is not CPU clock frequency dependent; in other words if I put 100 us in the period field of Timer - Instance Settings in cfg file I expect that the GPIO is toggle every 100us independent of CPU clock frequency but it is not.
Below my C code:
extern Semaphore_Handle semGG;
CSL_GpioHandle GPIO_handle;
Task_Handle task;
Error_Block eb;
Uint8 outData;
Uint8 count;
/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");
GPIO_handle = CSL_GPIO_open(0); // Opens GPIO Instance 0
CSL_GPIO_setPinDirOutput(GPIO_handle, GPIO_5); // set GPIO_5 to be output
CSL_GPIO_setPinDirOutput(GPIO_handle, GPIO_10); // set GPIO_10 to be output
while (1)
{
Semaphore_pend(semGG, BIOS_WAIT_FOREVER);
CSL_GPIO_setOutputData(GPIO_handle, GPIO_10); // set GPIO_10 to 1
for (count = 0; count < 50; ++count)
{
/*insert a counter to simulate a brief delay*/
}
CSL_GPIO_clearOutputData(GPIO_handle, GPIO_10); // clear GPIO_10 to 0
}
System_printf("exit taskFxn()\n");
System_flush(); /* force SysMin output to console */
}
void testTimer(void)
{
CSL_GPIO_setOutputData(GPIO_handle, GPIO_5); //set GPIO_5 to 1
Semaphore_post(semGG);
CSL_GPIO_clearOutputData(GPIO_handle, GPIO_5); //set GPIO_5 to 1
}
/*
* ======== main ========
*/
Int main()
{
Task_Handle task;
Error_Block eb;
System_printf("enter main()\n");
Error_init(&eb);
task = Task_create(taskFxn, NULL, &eb);
if (task == NULL)
{
System_printf("Task_create() failed!\n");
BIOS_exit(0);
}
BIOS_start(); /* does not return */
return (0);
}
Please could anyone help me?
Thanks In advance
Geni