English
Language : 

RV-8523 Datasheet, PDF (36/57 Pages) MICORO CRYSTAL SWITZERLAND – Real Time Clock
Micro Crystal
Real Time Clock / Calendar Module
RV-8523
Countdown timer function:
When configured as a countdown timer (TAC[1:0] = 01), timer A counts down from the software programmed 8-bit
binary value n in register Timer A (11h). When the counter reaches 1, the following events occur on the next rising
edge of the timer clock (see figure below):
• The countdown timer flag CTAF (register Control 2) is set logic 1
• When the interrupt generation is enabled (CTAIE = 1), an interrupt signal on INT_1 is generated
• The counter automatically reloads
• The next timer-period starts
General countdown timer behavior:
In this example, it is assumed that the countdown timer flag (CTAF) is cleared before the next countdown period
expires and that the interrupt output is set to pulse mode.
At the end of every countdown, the timer sets the countdown timer flag CTAF (register Control 2). CTAF may only
be cleared by using the interface. Instructions, how to clear a flag, are given in section 9.5.
When reading the timer, the current countdown value is returned and not the initial value n. Since it is not possible
to freeze the countdown timer counter during read back, it is recommended to read the register twice and check for
consistent results.
If a new value of n is written before the end of the actual timer-period, this value takes immediate effect. It is not
recommended to change n without first disabling the counter by setting TAC[1:0] = 00 (register Timer & CLKOUT).
The update of n is asynchronous to the timer clock. Therefore changing it on the fly could result in a corrupted
value loaded into the countdown counter. This can result in an undetermined countdown period for the first period.
The countdown value n will be correctly stored and correctly loaded on subsequent timer-periods.
Loading the counter with 0 effectively stops the timer.
When starting the countdown timer for the first time, only the first period does not have a fixed duration. The
amount of inaccuracy for the first timer-period depends on the chosen source clock, see next page table.
36/57