Re: Reading the RTC
- From: Serge Bets <serge.bets@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Sep 2007 16:09:34 +0200 (CEST)
On Wednesday, September 26, 2007 at 15:51:49 +0200, Spoon wrote:
CMOS_WRITE(save_control, RTC_CONTROL);
CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT);
Does the RTC reset when I write RTC_FREQ_SELECT?
The comments there indicate that the combination of negating RTC_SET and
RTC_DIV_RESET2 in that order restart the oscillator. So IIUC that's those
2 last writes, to RTC_CONTROL and RTC_FREQ_SELECT registers.
I noticed the 500-ms error when I used util-linux-2.12q hwclock (which
I thought at the time was the latest version).
That was an util-linux misfeature, fixed in ng-2.13
STEP 1: Synchronize system clock within 50 ms
STEP 2: Write the system time to the RTC
BTW some operations of hwclock can benefit from a system clock ticking
at the good frequency. At some level of wanted precision, it is better
to preset frequency via ntptime -f, adjtimex -f, ntpd, or whatever.
Or it may have something to do with this:
Recognize Linux rtc device bug where read() returns immediately
instead of waiting for the update interrupt.
Not linked: that's another problem.
Serge.
--
Serge point Bets arobase laposte point net
.
- References:
- Reading the RTC
- From: Spoon
- Re: Reading the RTC
- From: Serge Bets
- Re: Reading the RTC
- From: Spoon
- Reading the RTC
- Prev by Date: Re: NTP with a Serial PPS
- Next by Date: Re: Reading the RTC
- Previous by thread: Re: Reading the RTC
- Next by thread: Re: Reading the RTC
- Index(es):
Relevant Pages
|
|