AnsweredAssumed Answered

Integrated RTC to human reaadable format

Question asked by Fco. Javier Rodriguez G on Dec 22, 2019
Latest reply on Dec 28, 2019 by Fco. Javier Rodriguez G

Hi,

 

Some microcontrollers from NXP include a RTC module (which is not a true RTC chip). This module has a 32 bit counter that counts once per second to keep track the time even when the main power supply is absent. The company ST does the same with its uC.

 

In order to keep track of the time in the format we're used to, we need to convert the integer value of the counter to day/month/year, hh:mm:ss. In a console program it's too easy because of the library functions in <time.h>.

 

I'm wondering whether we can use such library in order to convert seconds to calendar/time, as mentioned, in our projects. I understand we need to provide somehow to the library the integer seconds from our uC when our system boots up. 

 

I haven't found the time.c file in the MCUXpresso installation. Looking inside this file (if it exists) I might figure out how to inject my counter (I hope so). Has someone tried to use time.h and time.c module in tiny uC (LPC11U68, for example)?

 

There's always the option to code our own algorithms in case what I'm asking is not possible, or even worst, to use an external I2C chip. Any hints?

 

Thanks!!!

Outcomes