REGISTERS
The MC146818A has four registers which are accessible to
the processor program. The four registers arealsofullyac-
cessible during the update cycle.
REGISTER A ($OA)
MSB LSB Read/ Write
b7 b6 b5 b4 b3 b2 bl bO
Register
UIP DV2 DV1 DVO RS3 RS2 RS1 RSO
except UIP
UIP – The update in progress (UIP) bit is a status flag that
may be monitored by the program. When UIP is a “l”, the
update cycle is in progress or will soon begin. When UIP is a
“U’, the update cycle is not in progress and will not be for at
least 244 ps (for all time bases). This is detailed in Table 6.
The time, calendar, and alarm information in RAM is fully
available to the program when the UIP bit is zero – it is not
in transition. The UIP bit is a read-only bit, and is not affected by Reset. Writing the SET bit in Register B to a “l”
inhibits any update cycle and then clears the UIP status bit.
TABLE 6 – UPDATE CYCLE TIMES
Time Base
Minimum Time
Update Cycle~me
Before Update
UIP Bit
(Oscl)
(tuc)
Cycle (tBuC)
1
4.lWW MHz Z@ ps
—
1 1.046576 MHz Z& fls
—
1 32.766 kHz lw~s
—
o 4.194304 MHz
—
244 fis
o 1.M576 MHz
—
244 ps
o 32.766 kHz
—
244 fis
DV2, DVI, DVO – Three bits are used to permit the Dro-
gram to select various conditions of the 22-stage divider
chain. The divider selection bits identify which of the thre:~
time-base frequencies is in use. Table 4 shows that tJ,ti’&j2,
bases of 4.194304 MHz, 1.046576 MHz, and 32.7~ k~~)~~, ‘“
be used. The divider selection bits are also used to$,~j&~,J~&
divider chain. When the time/calendar is first ini~~t~~:~~the
program may start the divider at the precise,~~$~&red in
the RAM, When the divider reset is removed;~~~:~wt update
cycle begins one-half second later. Thes%.th~e read/write
bits are not affected by RESET. ~d’”: >~-
..
;.i
..:.,\~,
~
,{.,!$.~..$..*.,.>*,,,
RS3, RS2, RS1, RSO – The fo$~ ray selection bits select
one of 15 tapes on the 22-sta~.~W~~&@P,or disable the divider
output. The tap selected may ~.~hed to generate an output
square wave (SQW pin) ~i~or &periodic interrupt. The program may do one of ~~~~wing: 1) enable the interrupt
with. the PIE bit, ~~~~~le the SQW output pin with the
SQWE bit, 3) en@’~th at the same time at the same rate,
or 4) enable n,g~w~~~”able 5 lists the periodic interrupt rates
and the sqq~re-.g%ve frequencies that may be chosen with
the RS ~j~%h@e four bits are readlwrite bits which are not
affecte,~Q~’%ES ET.
~,.,1,
$,,,,.)e~,{.,
REGl~Ei B ($OB)
MSB LSB
Read/ Write
b71b61b51b41 b31b21bl bO
Register
SET
I PIE I AIE ] UIEI SQWEI DM ] 24/12 I DSE
SET – When the SET bit is a “O’, the update cycle functions normally by advancing the counts once-per-second.
When the SET bit is written to a “1”, any update cycle in
1— @ MOTOROLA
progress is aborted and the program may initialize the time
and calendar bytes without an update occurring in the midst
of initializing. SET is a read/write bit which is not modified
by RESET or internal functions of the MC146818A.
PIE – The periodic interrupt enable (PIE) bit is a
read/write bit which allows the periodic-interrupt flag (PF)
bit in Register C to cause the l~pin to be driven low. A program writes a “1” to the PIE bit in order to receive periodic
interrupts at the rate specified by the RS3, RS2, RSI, and
RSO bits in Register A, A zero in PIE blocks l~Q from being
initiated by a periodic interrupt, but the periodic flag (P~) bit
is still set at the periodic rate. PIE is not modified b~,a~&$~o-
AIE – The alarm interrupt enable (Al E) ~T$f&j&i$&ad/write
bit which when set to a “1” permits the @~rfl~~& (AF) bit in
Register C to assert IRQ. An alarm inte~~@’\$occurs for each
second that the three time bytes e~~~~~~&i?hree alarm bytes
(including a “don’t care” alarm &od&tQ~ binary 1IXXXXX).
When the AIE bit is a “U’, the ~~~jt does not initiate an ~Q
signal. The RESET pin cle~f~~s~~% “V’. The internal functions do not affect the ,~~,t~t~
UIE – The UIE (q~~~~~%%ded interrupt enable) bit is a
read/write bit which e’, ~7~s the updat%end flag (UF) bit in
%
Register C to a@~,,lf The RESET pin going low or the
SET bit goin~~~~~c~ears the UIE bit.
.4,
:$,.
SQW~;~~&&n the square-wave enable (SQWE) bit is set
to a “l’’k~~ the program, a square-wave signal at the frequ~~y spefified in the rate selection bits (RS3 to RSO) apW$S @ the SQW pin. When the SQWE bit is set to a zero
,,,,,~@e~QW pin is held low. The state of SQWE is cleared by
,,~,;~~~~”k ESET pin. SQWE is a read/write bit.
*$:=:,.,:.
+:,8 DM – The data mode (DM ) bit indicates whether time
.1,..,}
and calendar updates are to use binary or BCD formats. The
?’
DM bit is written by the processor program and maybe read
by the program, but is not modified by any internal functions
or RESET. A “l” in DM signifies binary data, while a “U’ in
DM specifies binary-coded-decimal (BCD) data.
24/12 – The 24/12 control bit establishes the format of
the hours bytes as either the 24hour mode (a “l”) or the
12-hour mode (a “U’), This is a read/write bit, which is af-
fected on Iy by software.
DSE – The daylight savings enable (DSE) bit is a
readlwrite bit which allows the program to enable two
special updates (when DSE is a “1”). On the last Sunday in
April the time increments from 1:59:59 AM to 3:00:00 AM.
On the last Sunday in October when the time first reaches
1:59:59 AM it changes to 1:00:00 AM. These special updates
do not occur when the DSE bit is a ‘JO’. DSE is not changed
by any internal operations or reset.
REGISTER C ($OC)
MSB
LSB
Read-Only
b7/b61b51b4 b3 b bl I bO
Register
IRQFIPFIAFIUFIOIO jOIO
IRQF – The interrupt request flag (IRQF) is set to a “l”
when one or more of the following are true:
PF=PIE=”I”
AF=AIE=”I”
UF=UIE=”I”
i.e., IRQF= PF*PIE+ AF*AIE+UF*UIE
Semiconductor Products Inc.
15