6
\$\begingroup\$

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. But is there any RTC IC which can provide more fine resolution like in milli seconds and microseconds?

\$\endgroup\$
  • 2
    \$\begingroup\$ Why not use timers, referenced to an external source? Note that it might take more than a microsecond to access an external RTC .. \$\endgroup\$ – pjc50 Mar 12 '13 at 13:05
  • 1
    \$\begingroup\$ Perhaps 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. \$\endgroup\$ – Chintalagiri Shashank Mar 12 '13 at 13:28
  • 1
    \$\begingroup\$ then 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. \$\endgroup\$ – placeholder Mar 12 '13 at 13:51
  • 1
    \$\begingroup\$ Why dont you use microcontroller internal timer which will give you resolution and synchronize logger output with RTC at the beginning of logging. \$\endgroup\$ – Gossamer Mar 12 '13 at 13:57
  • 1
    \$\begingroup\$ For 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. \$\endgroup\$ – Gustavo Litovsky Mar 12 '13 at 13:59
11
\$\begingroup\$

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.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.