Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 6 months ago.
RTC in KL25Z
Do you know if it is possible to use the RTC of the KL25Z board?
3 Answers
11 years, 6 months ago.
On the time page it has a comment on the RTC setup used on the KL25Z, so I guess it should work.
11 years, 6 months ago.
The RTC will work the same as the Mbed LPC1768, however there are some very important differences you need to know.
The 32kHz RTC clock input is derived from the SDA mcu, so when reflashing or reseting the KL25Z the RTC registers will loose some time, or stop counting durring that process, a matter of 10 seconds when reflashing and a couple of seconds on reset. This does not happen with the LPC1768.
The RTC clock does not have a back up voltage input (Vb on the LPC1768) to keep it running when the processor is not powered. So to keep the RTC going you will need to keep the power (3.3v) to the chip and a 32kHz input to the RTC Clk input. This process will take around 9mA (for the KL25Z chip on its own) so for long term RTC back up the KL25Z is a non starter at the moment.
If you look at this link you can see a little more info on this:
http://mbed.org/forum/electronics/topic/4368/
You can see where I have added a low power 32kHz oscillator chip from Farnell (£3 I think) and this works well all the time the processor is powered.
I belive it is possible to generate the 32kHz from the KL25Z's own internal clock source and feed it back into the RTC Clk input, I have asked this question a couple of times now, but I think no one has the answer. Even if this was possible I think the KL25Z would consume too much power to keep the clock generators running durring RTC back up.
If you want RTC functions for the KL25Z then I would suggest this:
11 years, 6 months ago.
Have a look at Freescales site https://community.freescale.com/docs/DOC-94734 they do a step by step, although its not mbed Yours Simon M..
Thanks Simon, I have seen something similar to this, however any ideas how to put this code into Mbed to configure the registers?
posted by 14 May 2013Hi Paul, It shouldn't be a problem putting these registers in mBed online as if in case the mBed library has the declarations all filled in, the same as it happens in Arduino
posted by 06 Jun 2013The embed library does have the RTC registers defined. They are defined in RTC_Type in the MKL25Z4.h file. I need a low power RTC for my project so I will need to do this to achieve battery capability. I will also need to change clock and power modes. I am only a beginner so progress will be slow. The RTC and the slow internal reference clock (RC osc only, but factory trimmed and can be auto-trimmed if their is a xtal osc as an external reference). The RTC and internal ref. systems appears able to run in stop mode. See the Sub-Family Reference Manual for further details.
cheers pete
posted by 24 Sep 2013
Can this lib help you? http://mbed.org/users/clemente/code/FRDM_RTC/
Regards Clemente
posted by clemente di caprio 24 Sep 2013Does kl25z have inbulid RTC? If yes how to use it?
posted by Shreya Makineni 16 Feb 2017