My system will be off many times during a day but when turned-on, it must show the proper date (yy-mm-dd/hh:mm:ss) on its LCD.
Hello,
Hope your able to use the rtx of lpc15xx and get the desired result
In fact I´m already using the LPC15xx family, at least in 12 different projects. But due to this RTC bug, once the device is on, I "control" the DATE/TIME information based on the sys-tick timer. And at each 5 minutes (considering the device was not powered-off) I´m reprograming the RTC->COUNT register with minus 1 second, but keep showing the DATE/TIME info according my sys-tick timer cadence. I know this is stupid ... not the more accurate way to solve the problem ... but according my measures, at each 5 minutes the RTC timer increases 1 second at the counting. Well, any way, LPC15xx is a great solution to my products and RTC accuracy is not tremendously mandatory and with this dumb work-around I´m solving this inconvenient problem.
Hello,
If ur using keil ide then you can directly #include"time.h" in your project. Also refer to https://www.epochconverter.com/programming/c for the time.
Hi Zaid. Once more I thank you for your tip.
Hello Xavier,
There is this thing "epoch time". You can refer to the website.https://www.epochconverter.com
The lpc15xx rtc increments counts every second so use the value to calculate the time.
Also there is a "C" library "time.h" its has functions strftime(), mktime(), ctime. You can use these function to calculate the time.
Dear Zaid, I thank you so much for your tip. Very very very interesting. In fact, my solution is based in some tables with the amount of counting seconds since 2000 til 2099. And 2 tables with seconds to a regular and leap year. But your suggestion looks more professional and embracing as mine ... Thanx a lot !!! I was trying to know how to use the libraries you´ve mentioned but I didn´t find any reference of how to do it, how to get them or how to order them ... Any additional tip?
Regards,
Xavier
Hello Xavier,
In the user manual of the LPC15xx (UM10736) Chapter 18: LPC15xx Real-Time Clock (RTC) you will find that the RTC doesn't have a register for clock and date. So if you want to "create" the following structure yy-mm-dd/hh:mm:ss you can use the RTC as base clock, since it's really precise but you will have to make your own implementation for the clock and the date. If you want to see how to configure the RTC you can use the examples of the LPCOpen as a guide.
Hope it helps!
Have a great day,
Victor.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jimenez! I thank you for your reply. In fact I´m already doing it, inside my code, by means some tables based on seconds values. I thought there was something very well ellaborated ... problably my way of doing that is not the best one. But anyway, I thank you so much for your tips.
Have a nice day !!!
Xavier
Unfortunately, there is an errata about RTC on LPC15xx, and currently, there is no work-around on this:
Hi Tang. That´s true ... Thanks for remaind me ... I will try to work-around this bug by my self.
Regards,
Xavier