![](http://datasheet.mmic.net.cn/140000/SPAK56853FG120_datasheet_5015152/SPAK56853FG120_358.png)
Functional Description
MOTOROLA
Time Of Day (TOD)
14-5
Preliminary
14
14.4 Functional Description
A sub block of TOD implements the scaler, seconds, minutes, hours and days counters.
The counters can be initialized with the current time when the TOD module is disabled
(when TODEN = 0).
14.4.1 Scaler
Depending upon the frequency of the clock fed to the TOD module, the appropriate value
should be written to the clock scaler load register to derive a 1Hz clock. The scaler counter
is a 16-bit up counter, counting from zero while less than the value specified in the clock
scaler register. In normal operation, the scaler counter increments with TOD_CLK input
(frequency range from 1-65536 Hz) if TODEN = 1. The base (1Hz) clock is generated
when the scaler counter wraps and is used to clock the time of day counters and 1Hz
interrupt.
14.4.2 Time Units
Time units (seconds, minutes, hours, days) are each implemented as counter/register pairs.
14.4.2.1 Time Counters
The time counters are a set of modulo counters that are clocked by the 1 Hz clock to
maintain the current time in seconds, minutes, hours and days. They count only when
TOD EN = 1. These counters maintain the time to the accuracy of the 1 Hz clock. They
initialize to the current value in the time registers at the first 1Hz clock (one second) after
TODEN is set to 1 and advance each second thereafter.
14.4.2.2 Time Registers
Time registers are provided to set and observe the corresponding counters. When TODEN
is set to 1, the registers capture the counter values two IP_CLK cycles after the 1Hz clock
and are readable but not writeable. When TODEN is set to 0, they will contain the current
value of the time counters and they may be read or written.
14.4.2.3 Time of Day Lock Bit
When set, the TOD Lock Bit disables the continuous transfer of time of day counter values
to the registers when TODEN is 1. This permits a read of each of the four time registers
without the possibility of an in-process advancement of time values. The TOD_LOCK bit
should remain set at 0 except while reading the time registers when TODEN = 1.