RTC using external clock source on EXTAL0 on Kinetis L25

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RTC using external clock source on EXTAL0 on Kinetis L25

816 Views
eyaldoron
Contributor II

Hi all,

I'm confused concerning the RTC clocking. I want to input an externally-supplied 32kHz clock signal into EXTAL0 and run the KL25 in FEE mode. I also want the RTC to operate, both in run and in Stop mode. What is confusing to me is the following:

1) Both the OSC and the RTC peripherals contain register flags which control oscillator on/off and loading capacitors. However, in the KL25 there is only one oscillator (there is no separate RTC oscillator like in the K series devices). The system oscillator is controlled by the OSC0_CR register flags. So, what are the RTC register flags in RTC_CR controlling?

2) Suppose I set the system oscillator in bypass mode, and input a 32kHz signal into EXTAL0. I can also configure the system oscillator to remain on in low-power modes. Can I then run the RTC using the OSC32KCLK input clock?

Thanks,

Eyal Doron

Labels (1)
0 Kudos
1 Reply

472 Views
galadragos
Contributor III

The RTC has some configuration bits in the SIM module (SIM->SOPT1[OSC32KSEL]) which will allow you to set the RTC clock source.

By the default the RTC runs of the external oscillator, which must have a clock of 32kHz to be used as such. You have an option to use an external 32kHz clock on RTC_CLKIN pin independent of main OSC.

I recommend using the internal LPO because the RTC is not battery backed up and it's accuracy is very crystal/oscillator dependent.

Haven't figured out why RTC_CR oscillator and load control bits even exist, maybe they are copies of the OSC0_CR bits, meant for backward compatibility and having the same function in both registers.

There is only one crystal oscillator in the chip, but you can use the main clock derived from one of the internal oscillators and multiply it through FLL, so you can assign the crystal oscillator to the RTC exclusively.

-----------------

Edit: Typo

0 Kudos