RTC does not advance time counter

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

RTC does not advance time counter

跳至解决方案
2,985 次查看
mscovel
Contributor III

The RTC Time Seconds Register (TSR) and Timer Prescaler Register (TPR) do not increment while the K65 is running/single stepping (nor powered off with a battery connected).

The tower does not have this problem. Both TSR and TPR run (constantly increment) and when powered off/on the TSR is updated to reflect the elapsed time.

Furthermore, the KSDK example rtc_example_twrk65f180m sets an RTC alarm and waits for it to happen. This works on the tower and not on our board. 

I'm thinking there is some K65 errata that Freescale/NXP don't know about yet.

Could this be related to MCG clock speed?

Has anybody seen this problem or does anyone have any idea how to fix it?

标记 (1)
1 解答
2,496 次查看
mjbcswitzerland
Specialist V


Hi Mark

Check your 32kHz crystal on your own HW - without this oscillating the time will never increment (as in your case).
If this is not the cause, check that the RTC oscillator intialisation has not been missed somehow; ie. setting RTC_CR_OSCE bit in RTC_CR.

Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis K66:
- http://www.utasker.com/kinetis/TWR-K65F180M.html
- http://www.utasker.com/kinetis/FRDM-K66F.html
- http://www.utasker.com/kinetis/TEENSY_3.6.html

Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

在原帖中查看解决方案

4 回复数
2,496 次查看
deniscollis
Contributor V

I had the same problem with a custom K81 board.  The RTC did not run with any new MCUXpresso project.   But it did run with some example code.  On investigation I found that the watchdog setup in the demo checked and set the RTC CR OSCE bit, because it needed the RTC Time Alarm. The side-effect was that the RTC ran beautifully...   until I disabled the watchdog.  To preserve sanity I set the OSCE bit right after the RTC_Init

 rtc_config_t rtcConfig;
 RTC_GetDefaultConfig(&rtcConfig);
 RTC_Init(RTC, &rtcConfig);
 RTC->CR |= RTC_CR_OSCE_MASK; // Enable Oscillator
 RTC_StartTimer(RTC);
0 项奖励
回复
2,497 次查看
mjbcswitzerland
Specialist V


Hi Mark

Check your 32kHz crystal on your own HW - without this oscillating the time will never increment (as in your case).
If this is not the cause, check that the RTC oscillator intialisation has not been missed somehow; ie. setting RTC_CR_OSCE bit in RTC_CR.

Regards

Mark


Kinetis: http://www.utasker.com/kinetis.html
Kinetis K66:
- http://www.utasker.com/kinetis/TWR-K65F180M.html
- http://www.utasker.com/kinetis/FRDM-K66F.html
- http://www.utasker.com/kinetis/TEENSY_3.6.html

Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

2,496 次查看
mscovel
Contributor III

That's what was wrong. The RTC oscillator was not running. Thanks Mark!

0 项奖励
回复
2,496 次查看
mscovel
Contributor III

That’s good info Mark. Thank you!

Thanks

Mark Scovel

0 项奖励
回复