Real Time Clock Setup on LPC4357

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by PN on Tue Feb 18 12:43:17 MST 2014

In my current application, I use the real time clock driver provided on lpcware. Initially, reading and writing the RTC seemed to

work well with this driver. But once I added a watchdog timer to the application, somehow the RTC seemed to have issues during


The RTC_Init() routine would always crash when stepping through it on the debugger and the clock time was always off.

I guess it could be either because it would take forever for the time value to be set and the clock to start running, or because the

clock would freeze, not get initialized with the new time and start running again from where it left off.

I tried adding a delay of 2 seconds after every RTC register write, based on what I read about the LPC RTCs. This seemed to

allow me to step through the Keil debugger but the time was still not set correctly. It would lag by several minutes.

If I take the watchdog timer out, everything works perfectly fine with no changes to the RTC driver.

On the other hand if I keep the watchdog timer in and do not write or set the RTC, everything works fine then too.

Has anyone had a similar issue with real time clock setup? Any suggestions?

Thanks in advance!