How to create a Real Time Clock? I know that I can connect an external 32k crystal, or use internal 32k RC oscillator, but can I get a 1 sec pulses that are not lost in all modes. Is there an internal counter that would count in sleep/deep sleep mode that I could use?
How accurate can it be?
I would like to use the clock in Zigbee scenes, timed on/off etc.
No related topics |
Hi,
You can call clock_time() get current system Timer time in non-sleep mode,and use cpu_sleep_wakeup(DEEPSLEEP_MODE_RET_SRAM_LOW16K , PM_WAKEUP_TIMER,(clock_time() + 1000*CLOCK_16M_SYS_TIMER_CLK_1MS)); to set one sec sleep in sleep mode