Re: Reading the RTC



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
.



Relevant Pages

  • Reading the RTC
    ... systohw reads the current system time, then sleeps until the next whole second, then writes that date to the RTC. ... readrtc sets up the RTC to raise an IRQ at 1 Hz, then sits in a loop waiting for the IRQ, printing the system time every time the OS catches an IRQ. ...
    (comp.protocols.time.ntp)
  • Re: Setting The System Clock [Linux]
    ... but chrony also corrects for your rtc errors. ... >the rtc, subtract 28800 sec, and set your Linux system time to that. ... >it is on local time, and display that time. ...
    (comp.os.linux.misc)
  • Re: `top` reports all CPU states as 0% on i386
    ... Yikes! ... I think my RTC has left the building! ... kern.timecounter.hardware=i8254 to /etc/sysctl.conf because the system clock ... was going insane - it was counting off an hour of system time in the matter ...
    (freebsd-current)
  • Re: How to disable the RTC?
    ... It is not because you see the clock in the taskbar that the RTC hardware ... is sollicited (i.e. is the soft RTC does its job, the hard RTC will no be ... "System Time", which is normally delivered by the RTC. ... GetSystemTime function is called and ends in Bare_GetRealTime (if you ...
    (microsoft.public.windowsce.platbuilder)