Hello,
for an application with a Kinetis K64 Processor i need a PIT to trigger a periodic task.
A task executed, 5 seconds after startup, is used for the PIT configuration. But if i do not not power up the PIT module separately, the PIT is not startet.
With a breakpoint after POWER_UP(6, SIM_SCGC6_PIT); / before the PIT_MCR register is written in "fnConfigureInterrupt" [kinetis.c], it works as well.
Without ececuting the power up sequence for the PIT, i need to clear the PIT_MCR_MDIS flag manually to start the PIT.
This error only does occur in a larger project, but not in a vanilla uTasker 1.4.7.
May there be a race condition ?
I attached a screenshot of the assembly code from the working and the non-working configuration.
Regards,
Fabian
static void timed_main_Task(void){
.... Code ....
}
extern void fnXSetupTask (TTASKTABLE *ptrTaskTable){
/*configure PIT */
PIT_SETUP x_pit_setup;
x_pit_setup.int_type = PIT_INTERRUPT;
x_pit_setup.int_handler = timed_main_Task;
x_pit_setup.int_priority = X_PIT_PRIORITY;
x_pit_setup.count_delay = PIT_US_DELAY(104000);
x_pit_setup.mode = PIT_PERIODIC;
x_pit_setup.ucPIT = 0;
POWER_UP(6, SIM_SCGC6_PIT);
fnConfigureInterrupt((void *)&x_pit_setup);
}