linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Jerry Van Baren <vanbaren_gerald@si.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Using realtime clock?
Date: Wed, 10 Jan 2001 16:06:45 +0100	[thread overview]
Message-ID: <200101101506.f0AF6j408007@denx.local.net> (raw)
In-Reply-To: Your message of "Wed, 10 Jan 2001 07:33:58 EST." <4.3.2.20010110072315.00bb5230@falcon.si.com>


In message <4.3.2.20010110072315.00bb5230@falcon.si.com> Jerry Van Baren wrote:
>
> The "proper" way to handle a RTC is to read it on power up and set the
> system clock based on it.  From then on, the system clock will be
> correct and everyone will use the system clock efficiently and accurately.

Well, that's the way  it's  often  done,  but  it's  far  from  being
perfect. On many embedded systems I'm working with the RTC is running
from  a high precision oscillator which provides much better accuracy
than the system clock. Both clocks will drift, and usually there will
be a noticable difference after a few days. This is not really nice.

> On the x86 (PC host), the utility is "hwclock" (man hwclock).  Your
> best approach is to get the source for that, modify it to read your RTC
> hardware (which may be different from the PC RTC hardware, although you
> might get lucky and only have to deal with endian issues).  Then add a
> call to it in your startup scripts, typically in /etc/rc.d/rc.local.

Any idea how to keep the system clock permanently synchronized to the
RTC?

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
In an infinite universe all things are possible, including the possi-
bility that the universe does not exist.
                        - Terry Pratchett, _The Dark Side of the Sun_

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~2001-01-10 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10  4:16 Using realtime clock? Jari Nguyen Trung Thanh
2001-01-10  9:30 ` Gabriel Paubert
2001-01-10 12:33   ` Jerry Van Baren
2001-01-10 13:22     ` Jari Nguyen Trung Thanh
2001-01-10 15:06     ` Wolfgang Denk [this message]
2001-01-10 15:56       ` Jerry Van Baren
2001-01-10 16:22         ` Wolfgang Denk
2001-01-10 16:51           ` Jerry Van Baren
2001-01-10 16:59             ` Bill Roman
2001-01-10 19:16             ` Gabriel Paubert
2001-01-10 19:05         ` Gabriel Paubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200101101506.f0AF6j408007@denx.local.net \
    --to=wd@denx.de \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=vanbaren_gerald@si.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).