[ntp:questions] Reading the RTC

Martin Burnicki martin.burnicki at meinberg.de
Wed Sep 26 07:24:12 UTC 2007


Hi,

Spoon wrote:
> I expected the RTC to raise the IRQ every time it counts a whole second,
> i.e. when there is no fraction of a second.
> 
> However, it seems like the RTC raises the IRQ when the fraction of a
> second is 0.5, not when it is 0.

If I remember correctly then the RTC chip used in the original PC design
started to increment the clock 0.5 seconds after the time had been written,
i.e. if you set the RTC at the real change of the second then the RTC time
would be 0.5 ahead of the real time.

We have used that chip also for some of our radio clocks and had implemented
some special code to compensate this "feature" by the firmware.

On the other hand, I don't know if current PC's RTC chips which may be
integrated into the chipset are duplicating that original behaviour, and
whether this is compensated by the BIOS (of course depending on the
manufacturer of the BIOS), or by some low level driver which may be
involved in setting the RTC.

You may try to keep an eye on when the RTC's second really changes. If it is
really off by 0.5 seconds after you have set it correctly this should be
clearly visible.

Martin
-- 
Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont
Germany




More information about the questions mailing list