Clock and Calendar
The time and date addresses in the RAM (see Table 6) provide
access to the seconds, minutes, hours, day of month, month,
year, week day, and week number. These parameters have the
ranges indicated on Table 6 and are in BCD format. If a
parameter is found to be out of range, it will be cleared on its
being next incremented. The V3021 incorporates leap year
correction and week number calculation. The week number
changes only at the incrementation of the day number from 7 to
1. If week 52 day 7 falls on the 25th, 26th or 27th of December,
then the week number will change to 0 otherwise it will be week
1. Week days are numbered from 1 to 7 with Monday as 1.
Reading of the current time and date must be preceded by a
Copy_clock_to_RAM command. The time and date status bits
9
will indicate which time and date addresses changed since the
last time the command was used (see Fig. 9). The time and date
from the last Copy_clock_to_RAM command is held
unchanged in the RAM, except when power (V
totally. To change the current time and date in the clock, the
desired time and date must first be written to the RAM, the time
set lock bit cleared, and then a Copy_RAM_to_clock command
sent (see Fig. 10). The time set lock bit can be used to prevent
unauthorized setting of the clock.
) has failed
DD
Frequency Measurement
Setting bit 0 at address 0 will put a pulsed current source (25
m
A)
onto the I/O pin, when the device is not chip selected (i.e. CS
input high). The current source will be pulsed on/off at 256 Hz.
The period for ± 0 ppm time keeping is 3.90625 ms. To measure
the frequency signal on pin I/O, the data bus must be high
impedance. The best way to ensure this is to hold the
microprocessor and peripherals in reset mode while measuring
the frequency. The clarity of the signal measured at pin I/O will
depend on both the probe input impedance (typically 1 M
W
)
and the magnitude of the leakage current from other devices
driving the line connected to pin I/O. If the signal measured is
unclear, put a 200 k
W
resistor from pin I/O to V . It should be
noted that the magnitude of the current source (25
m
A) is not
sufficient to drive the data bus line in case of any other device
driving the line, but it is sufficient to take the line to a high logic
level when the data bus is in high impedance.
Use a crystal of nominal C = 8.2 pF as specified in the section
“Operating Conditions”. The MX series from Microcrystal is
recommended. The accuracy of the time keeping is dependent
upon the frequency tolerance and the load capacitance of the
crystal. 11.57 ppm correspond to one second a day.
Setting the Current Time and Date
Fig. 10
Write seconds, minutes, hours, day
of month, week day, month, year
and week number to the RAM
Clear the time set lock bit, addr. 0, bit 4
Send a copy_RAM_to_clock command,
addr. E hex
Set the time set lock bit, addr. 0, bit 4
Reading the Current Time and Date
Fig. 9
Send copy_clock_to_RAM addr. F hex
Read time and data status bits, addr. 1
Is the seconds
status bit set,
addr. 1, bit 0
No
Yes
Current time and date
Read seconds, addr. 2
Is the minutes
status bit set,
addr. 1,
bit 1
Similar for hours, day of month,
week day, month, year and
week number
Read minutes addr. 3
Yes
No
R
V3021