Hello Everyone.
I am using Freescale MKE02Z32xxx4 micro-controller for one of my project, and everything works fine, the complete project is running fine. But my customer reports an issue, that the time taken for executing 10 minute cycle is longer than 10 minutes.
I checked it and found that 1 minute is acting a 1 minute 5 seconds, which means that, something i missed which is causing this behavior.
I am using SysTick to generate 1ms interrupt and using that I am checking timings required ( Example 10 minutes ).
The following is the initialization code.
void Timer_Init( void )
{
SysTick->LOAD = 20000u-1u;
SysTick->VAL = 0;
SysTick->CTRL |= SysTick_CTRL_CLKSOURCE_Msk;
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
}
This function will start the timer.
void Timer_start( void )
{
SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
SysTick->LOAD = 20000u-1u;
}
And the priority for the interrupt is 1, second highest.
I am using the the FEI mode.
Can anyone tell me what mistake i had done, and how can I correct it.
Please let me know if any other input is required from my side.
Thanks in Advance.
已解决! 转到解答。
Hi Arun,
The default frequency of Slow internal reference clock may error in CodeWarrior10.7 with Processor Expert.
After input 31.25kHz for factory trimmed IRC, we can see the frequency of Core.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Actually I am new to this micro-controller and after using CodeWarrior, I cam to know that the clock is around 16.66MHz and after updating that values, system works properly with correct timings.
Hi Arun,
The default frequency of Slow internal reference clock may error in CodeWarrior10.7 with Processor Expert.
After input 31.25kHz for factory trimmed IRC, we can see the frequency of Core.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Robin.
Can you help me in code protection for KE02 series.
I am using IAR and I don't understand how can I protect my code.
It looks like that the Mass Protection is always enabled for this series of micro-controller (MKE02Z32xxx4).
So even if I accidentally secured the flash I can re-flash. Is it right??
I think it's better if I open a new thread for this.
You can mass erase the flash and then re-flash it. And please refer the method in 'Flash protection with IAR'.