5 alarm register group, Section 26–6.5, Table 26–576 – NXP Semiconductors LPC24XX UM10237 User Manual

Page 655: Table 26–577, Nxp semiconductors

Advertising
background image

UM10237_4

© NXP B.V. 2009. All rights reserved.

User manual

Rev. 04 — 26 August 2009

655 of 792

NXP Semiconductors

UM10237

Chapter 26: LPC24XX Real-Time Clock (RTC) and battery RAM

[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.5 Alarm register group

The alarm registers are shown in

Table 26–578

. The values in these registers are

compared with the time counters. If all the unmasked (See

Section 26–6.2.6 “Alarm Mask

Register (AMR - 0xE002 4010)” on page 653

) alarm registers match their corresponding

time 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]).

Table 576. Time Counter relationships and values)

Counter

Size

Enabled by

Minimum value

Maximum value

Second

6

Clk1 (see

Figure 26–134

)

0

59

Minute

6

Second

0

59

Hour

5

Minute

0

23

Day of Month

5

Hour

1

28, 29, 30 or 31

Day of Week

3

Hour

0

6

Day of Year

9

Hour

1

365 or 366 (for leap year)

Month

4

Day of Month

1

12

Year

12

Month or day of Year

0

4095

Table 577. Time Counter registers

Name

Size

Description

Access

Address

SEC

6

Seconds value in the range of 0 to 59

R/W

0xE002 4020

MIN

6

Minutes value in the range of 0 to 59

R/W

0xE002 4024

HOUR

5

Hours value in the range of 0 to 23

R/W

0xE002 4028

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]

R/W

0xE002 402C

DOW

3

Day of week value in the range of 0 to 6

[1]

R/W

0xE002 4030

DOY

9

Day of year value in the range of 1 to 365 (366 for
leap years)

[1]

R/W

0xE002 4034

MONTH

4

Month value in the range of 1 to 12

R/W

0xE002 4038

YEAR

12

Year value in the range of 0 to 4095

R/W

0xE002 403C

Advertising