I've been searching for high precision RTCs on Google but almost all RTCs like DS12C887, DS1307 provide time resolution in seconds which is ok for general use. Are there any RTC ICs which can provide finer resolution like in milliseconds and microseconds?
-
One more thing I would not like to use timers of the micro-controller. Please an external IC is required. – Osaid Mar 12 '13 at 12:59
-
2Why not use timers, referenced to an external source? Note that it might take more than a microsecond to access an external RTC .. – pjc50 Mar 12 '13 at 13:05
-
1Perhaps if you try to include why you need microsecond precision in an RTC, someone can explain what the conventional approach to your problem is. To expect microsecond accuracy is not generally useful for a number of reasons. – Chintalagiri Shashank Mar 12 '13 at 13:28
-
Application is a high speed data logger. – Osaid Mar 12 '13 at 13:46
-
@pjc50 it could take more than ONE microsecond but that doesn't matter still the resolution is better to have in microsecond if you have to access it multiple times in one mill-seconds. – Osaid Mar 12 '13 at 13:50
-
1then what you need is not a RTC, you need a regular sampling period driven off a 1 MHZ clock and perhaps a RTC time stamp at the beginning of sampling. – placeholder Mar 12 '13 at 13:51
-
1Why dont you use microcontroller internal timer which will give you resolution and synchronize logger output with RTC at the beginning of logging. – Gossamer Mar 12 '13 at 13:57
-
1For this level of synchronization it is typical to use GPS because it can provide nanosecond accuracy for the long term. But it depends what your application is. Otherwise a very accuracte external crystal can be used. – Gustavo Litovsky Mar 12 '13 at 13:59
-
@GustavoLitovsky Agreed. if I were to use GPS I would definitely go for it. Thank you – Osaid Mar 12 '13 at 16:20
1 Answers
I've often found it frustrating that external RTC devices (and for that matter even internal ones, for reasons I can't fathom) seldom offer resolution anywhere near that of the incoming time base, but I would find it extremely unlikely that any conventional RTC device would offer microsecond accuracy in any case. RTC chips are designed to minimize power consumption when the system is idle, and an RTC chip which used a 1MHz clock would almost certainly use more than 30 times as much energy as one that used a 32KHz clock.
Depending upon what you are trying to do, and your system's waking/sleeping patterns, it may be possible to use an RTC with somewhat coarse resolution in conjunction with a higher-speed timer/counter circuit which is triggered by an external event. Operation would be something like:
Have everything wait while asleep until the external event occurs
When the event occurs, start up a ~5MHz non-precision clock and start counting
Log the count and RTC time at the first tick of the RTC clock following the event
Log the count at the second tick of the RTC clock following the event
The difference between the count values at the two RTC ticks will indicate the rate of the non-precision 5MHz clock, and the count value at the first event will indicate how long before the first RTC tick the event took place.
For example, suppose that the RTC can be read in units of 1/256 second. On receives an event when the RTC clock reads 12:34:56 78/256. The RTC clock advances to 12:34:56 79/256 when the count reads 1,000, and then advances to 80/256 when the count reads 20,000. One could then figure that the "5MHz" clock was running at a speed of 4,864,000Hz, and thus the event happened 1,000/4,864,000 second before that second timer tick, which is to say--if the RTC clock was precisely correct--at a time of 12:34:56.3122944.
Note that one would have to wait up to 1/128 second to know the exact time when an event had occurred, but once one had seen the RTC advance twice one would know within a fraction of a microsecond the time of the event [and could thus determine very precisely the time between two distinct events between which the CPU had been sleeping]. Some Lattice Mach series CPLDs have a fast-starting clock oscillator which runs at 5MHz nominal, and have relatively low sleep currents, and thus might be usable for this sort of timekeeping.

- 45,939
- 2
- 84
- 143