RTC Question

06 Dec 2009

Where can I find time.h?

06 Dec 2009

From the following links it looks like it doesn't exist.

http://mbed.org/projects/libraries/api/mbed/trunk/rtc_time

http://mbed.org/blog/entry/103/

06 Dec 2009

Been in the primary svn trunk, its not public, need to know time_t type base to use it, the output functions all appear to be string format, which is fine for serial, file attributes and display work, but useless having to convert it all back for internal operations.

http://mbed.org/projects/libraries/svn/mbed/trunk

06 Dec 2009

NVM I worked it out, will post some code of what I am attempting to do shortly

06 Dec 2009

Hi,

Andrew Harpin wrote:
need to know time_t type base to use it
It is defined as:

typedef unsigned int time_t;
This is the common type definition on most 32-bit systems.

A good reference for all the time related functions you can use in C is something like the time.h page on C++ Reference. And you can just use it as an integer too if you want to do some low level maths based on it being seconds since Jan 1970.

Simon

29 May 2011

Hello,

Is there any way to get milliseconds out of the Mbed or any 4-wire SPI RTC chip with milliseconds resolution? Found some with hundreds of seconds but i would need to go lower then that.

thanx

30 May 2011

Hi,

Setup a free running 1KHz timer then sync it to the RTC using an interrupt service.

Dean.

31 May 2011

Thanks will give it a go!

28 May 2012

I set the RTC to generate an interrupt each second, and do a timer.reset in the interrupt routine to get the micro-second timer synchronizd to the RTC second.