How can we stop PE_LDD from overwriting the time in the RTC registers with the values in the PE properties panel on Power up?
Using MK22FX512VLH12 with KDS.
Hi Rande
I don't know the PE generated code but I expect that you can simply add a check of the validity of the timer and abort any initialistion (which should only be done when it is has not yet been configured)
if ((RTC_SR & RTC_SR_TIF) != 0) {
return; // RTC is alread operating so ignore
}
Note however that you will still need to ensure that the clock gate is enabled to the RTC after each reset (and to be able to check its validity) so the code will in fact look more like (similar to the uTasker time management solution):
POWER_UP(6, SIM_SCGC6_RTC);
if ((RTC_SR & RTC_SR_TIF) != 0) {
return; // RTC is alread operating so ignore
}
// Continue with the configuration...
Regards
Mark
Kinetis: µTasker Kinetis support
K22: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support
Time Management: http://www.utasker.com/docs/uTasker/uTasker_Time.pdf
For the complete "out-of-the-box" Kinetis experience and faster time to market
Thank you Mark for the reply. The problem is with PE, and we found a way
to make it work.
Thanks!
Rande Newberry
H-ITT, LLC, a Hyper-Interactive Teaching Technology Company
420 Shearer Blvd.-Cocoa, FL, 32922
PH: 888-322-0089
rande@h-itt.com
Hello,
I have provided answer on the same previous question, see Re: rtc resets at powerup.
Best Regards,
Marek Neuzil