PC RTC Settings
Table of Contents

PC CMOS RTC Settings

CMOS/RTC Register A

Bits Meaning
7 (read only) This bit is set when a time update is in progress. During that period you will not be able to rely on reads of the time registers (0..9) but access to other registers will not be impacted. When the update process has completed an Update-Ended interrupt can be generated. See Register B re. enabling this interrupt cause and Register C to find out how to know if such an interrupt has occurred.
6::4 RTC time base. These bits tell the chip what frequency of timer it has been connected to. In the PC the CMOS is wired to a 32,768Hz circuit. The correct and only valid value for these bits is 2'010.
3::0 Rate. These four bits hold a divisor which sets the rate of the Periodic Interrupt. See the table below for rates and periods and Registers B and C for how to enable and detect such interrupts.

The available rates for the periodic interrupt are as follows. If you want to construct a spreadsheet yourself the formulae for the frequency and period are as follows. Freq is 32768/(2 ** (rate - 1)). Period is 1/freq. Period in ms is 1000/freq.

Rate Frequency (Hz) Period (ms)
3 8192 0.1220703125
4 4096 0.244140625
5 2048 0.48828125
6 1024 0.9765625
7 512 1.953125
8 256 3.90625
9 128 7.8125
10 64 15.625
11 32 31.25
12 16 62.5
13 8 125
14 4 250
15 2 500

For example, if you want a periodic interrupt rate of 1024Hz set the rate in Register A to 6 (as long as the RTC time base is correct).

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License