RTC does not advance time counter

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RTC does not advance time counter

ソリューションへジャンプ
2,984件の閲覧回数
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,495件の閲覧回数
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,495件の閲覧回数
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,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

2,495件の閲覧回数
mscovel
Contributor III

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

0 件の賞賛
返信
2,495件の閲覧回数
mscovel
Contributor III

That’s good info Mark. Thank you!

Thanks

Mark Scovel

0 件の賞賛
返信