Hello Priya Dwivedula:
In the next thread I shared an example project about changing clock configurations and adapting the HWTIMER with MQX, please take a look at it. The project is for K64 but the same concept applies for the FRDM-K22F:
Re: KDSK CLOCK_SYS_SetConfiguration() no uptade ticks in _time_delay() MQX
If not using Processor Expert you still can look at the Events.c file to see the method I used to reconfigure the HWTIMER before and after the clock change by using the clock system notification framework. This is the code I used:
clock_manager_error_code_t clockMan1_SysTickCallback(clock_notify_struct_t * notify, void * callbackData)
{
clock_manager_error_code_t result = kClockManagerSuccess;
switch(notify->notifyType)
{
case kClockManagerNotifyBefore:
HWTIMER_SYS_Stop(&systimer);
break;
case kClockManagerNotifyRecover:
break;
case kClockManagerNotifyAfter:
HWTIMER_SYS_Init(&systimer, &BSP_SYSTIMER_DEV, BSP_SYSTIMER_ID, NULL);
HWTIMER_SYS_SetPeriod(&systimer, BSP_ALARM_PERIOD);
HWTIMER_SYS_RegisterCallback(&systimer,(hwtimer_callback_t)_time_notify_kernel, NULL);
HWTIMER_SYS_Start(&systimer);
break;
default:
result = kClockManagerError;
break;
}
return result;
}
Let me know if you have any doubts.
Best Regards!
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------