Report
5 years, 3 months ago.

KL46Z RTC in Battery Mode

The embed.h function "time(NULL)" stops as soon as you disconnect USB. Therefore, if you run off the optional 3V coin cell on the board, the real time clock doesn't work.

Is there any way to add a BatteryOperated class (or #define) to the library to fix that?

Comment on this question

2 Answers

5 years, 3 months ago.

The KL46 doesn't have an RTC crystal. Instead the interface IC generates a 32kHz clock signal which is used as clock source. But on coin cell that doesn't get powered. So no, you cannot easily change that simply because otherwise there is no clock source.

5 years, 3 months ago.

Unless you replace the 8Mhz crystal with a 32Khz crystal and change the clock set up, the only option is to use an external RTC, for instance one of these:

http://www.ebay.co.uk/itm/I2C-Tiny-RTC-DS1307-Real-Time-Clock-Module-AT24C32-Board-for-Arduino-AVR-SMD-PIC-/190934234297?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item2c749134b9


To post an answer, please log in.