Hi,
I am using Real Time Clock, and I am referring to following document :
[url]https://www.ghielectronics.com/docs/29/real-time-clock-rtc[/url]
There are few scenarios that I have to make sure.
1 . I set the current time and date using this function - RealTimeClock.SetDateTime(DT); . My application using Watchdog, so if something goes wrong then it will reset the device and run code again, so if it will run again then time will set back to whatever has defined in my code. I have defined like - public DateTime Date = new DateTime(2015, 8, 26, 11, 10, 1);. so , where can I set time so it will only run once, even though device will reset.
- In a case of power loss, once systems shutdown does clock still running ? . I tested, but found that it is not working as after powering device on Real time Clock gave me old date( 1/1/1977) . So, when system get power back, is there any way that I can set the time to current time ?
How could I make it code know that power has lost and now come back, so it can set the time ?
Thanks