Leap Year Calculation; Alarm Register Group; User Manual - Philips LPC2101 User Manual

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
Table 194: Time counter relationships and values
Counter
Second
Minute
Hour
Day of Month
Day of Week
Day of Year
Month
Year
Table 195: Time counter registers
Name
SEC
MIN
HOUR
DOM
DOW
DOY
MONTH
YEAR
[1]

17.4.13 Leap year calculation

The RTC does a simple bit comparison to see if the two lowest order bits of the year
counter are zero. If true, then the RTC considers that year a leap year. The RTC considers
all years evenly divisible by 4 as leap years. This algorithm is accurate from the year 1901
through the year 2099, but fails for the year 2100, which is not a leap year. The only effect
of leap year on the RTC is to alter the length of the month of February for the month, day
of month, and year counters.

17.4.14 Alarm register group

The alarm registers are shown in
with the time counters. If all the unmasked (See
(AMR - 0xE002 4010)" on page
counters then an interrupt is generated. The interrupt is cleared when a one is written to
bit one of the Interrupt Location Register (ILR[1]).

User manual

Size
Enabled by
6
Clk1 (see
6
Second
5
Minute
5
Hour
3
Hour
9
Hour
4
Day of Month
12
Month or day of Year
Size Description
6
Seconds value in the range of 0 to 59
6
Minutes value in the range of 0 to 59
5
Hours value in the range of 0 to 23
5
Day of month value in the range of 1 to 28, 29, 30,
or 31 (depending on the month and whether it is a
[1]
leap year).
3
Day of week value in the range of 0 to 6
9
Day of year value in the range of 1 to 365 (366 for
[1]
leap years)
4
Month value in the range of 1 to 12
12
Year value in the range of 0 to 4095
These values are simply incremented at the appropriate intervals and reset at the defined overflow point.
They are not calculated and must be correctly initialized in order to be meaningful.
Rev. 01 — 12 January 2006
Minimum value
Figure
57)
0
0
0
1
0
1
1
0
[1]
Table
196. The values in these registers are compared
Section 17.4.7 "Alarm Mask Register
217) alarm registers match their corresponding time
UM10161
Chapter 17: RTC
Maximum value
59
59
23
28, 29, 30 or 31
6
365 or 366 (for leap year)
12
4095
Access
Address
R/W
0xE002 4020
R/W
0xE002 4024
R/W
0xE002 4028
R/W
0xE002 402C
R/W
0xE002 4030
R/W
0xE002 4034
R/W
0xE002 4038
R/W
0xE002 403C
© Koninklijke Philips Electronics N.V. 2006. All rights reserved.
219

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2103Lpc2102

Table of Contents