PCA2125_1 © NXP B.V. 2008. All rights reserved.
Product data sheet Rev. 01 — 28 July 2008 13 of 36
NXP Semiconductors
PCA2125
SPI Real-time clock/calendar
To prevent the timer flags being overwritten while clearing bit AF, a logic AND is performed
during a write access. The flag is reset by writing a logic 0 but its value is not affected by
writing a logic 1.
Table 23 shows what instruction must be sent to clear bit AF. In this example, bit MSF and
bit TF are unaffected.
8.6 Timer functions
The countdown timer has four selectable source clocks allowing for countdown periods in
the range from less than 1 ms to more than 4 hours. There are also two pre-defined timers
which can be used to generate an interrupt once per second or once per minute.
Registers Control_2 (01h), Timer_control (0Eh) and Countdown_timer (0Fh) are used to
control the timer function and output.
8.6.1 Second and minute interrupt
The second and minute interrupts (bits SI and MI) are pre-defined timers for generating
periodic interrupts. The timers can be enabled independently of one another, however a
minute interrupt enabled on top of a second interrupt will not be distinguishable since it will
occur at the same time; see Figure 9.
Table 22. Flag location in register Control_2
Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Control_2 - - MSF - AF TF - -
Table 23. Example to clear only AF (bit 3) in register Control_2
Register Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Control_2 - - 1 - 0 1 - -
Table 24. Register Timer_control (address 0Eh) bit description
Bit Symbol Value Description Reference
7 TE 0 countdown timer is disabled
Section 8.6.2
1 countdown timer is enabled
6 to 2 - 0 unused
1 to 0 CTD[1:0] 00 4096 Hz countdown timer source clock
01 64 Hz countdown timer source clock
10 1 Hz countdown timer source clock
11
1
⁄
60
Hz countdown timer source clock
Table 25. Register Countdown_timer (address 0Fh) bit description
Bit Symbol Value Description Reference
7 to 0 COUNTDOWN_TIMER[7:0] 00h to FFh countdown value = n.
Section 8.6.2
CountdownPeriod
n
SourceClockFrequency
---------------------------------------------------------------
=