English
Language : 

UM10360 Datasheet, PDF (563/835 Pages) NXP Semiconductors – LPC17xx User manual
NXP Semiconductors
UM10360
Chapter 27: LPC17xx Real-Time Clock (RTC) and backup registers
Table 517. Consolidated Time register 2 (CTIME2 - address 0x4002 401C) bit description
Bit
Symbol
Description
11:0
31:12
Day of Year
-
Day of year value in the range of 1 to 365 (366 for leap years).
Reserved, user software should not write ones to reserved bits. The value read from a
reserved bit is not defined.
Reset
value
NC
NA
6.4 Time Counter Group
The time value consists of the eight counters shown in Table 27–518 and Table 27–519.
These counters can be read or written at the locations shown in Table 27–519.
Table 518. Time Counter relationships and values
Counter
Size Enabled by
Minimum value
Second
6
1 Hz Clock
0
Minute
6
Second
0
Hour
5
Minute
0
Day of Month 5
Hour
1
Day of Week 3
Hour
0
Day of Year
9
Hour
1
Month
4
Day of Month
1
Year
12 Month or day of Year 0
Maximum value
59
59
23
28, 29, 30 or 31
6
365 or 366 (for leap year)
12
4095
Table 519. Time Counter registers
Name Size Description
SEC
6
Seconds value in the range of 0 to 59
MIN
6
Minutes value in the range of 0 to 59
HOUR 5
Hours value in the range of 0 to 23
DOM
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 leap year).[1]
DOW
3
Day of week value in the range of 0 to 6[1]
DOY
9
Day of year value in the range of 1 to 365 (366 for leap years)[1]
MONTH 4
Month value in the range of 1 to 12
YEAR 12 Year value in the range of 0 to 4095
Access
R/W
R/W
R/W
R/W
Address
0x4002 4020
0x4002 4024
0x4002 4028
0x4002 402C
R/W
0x4002 4030
R/W
0x4002 4034
R/W
0x4002 4038
R/W
0x4002 403C
[1] 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.
6.4.1 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.
6.4.2 Calibration register (CALIBRATION - address 0x4002 4040)
The following register is used to calibrate the time counter.
UM10360_1
User manual
Rev. 01 — 4 January 2010
© NXP B.V. 2010. All rights reserved.
563 of 835