2 alarm, Nxp semiconductors – NXP Semiconductors UM10301 PCF2123 User Manual

Page 27

Advertising
background image

NXP Semiconductors

UM10301

User Manual PCF85x3, PCA8565 and PCF2123, PCA2125

UM10301_1

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

User manual

Rev. 01 — 23 December 2008

27 of 52

Table 5.

Setting the time and date

Sequence of commands / data to be sent

Binary (BCD)

HEX

Register
Address

Comments

generate

I

2

C start condition

1 0 1 0 0 0 1 0

A2

I

2

C slave address, write

0 0 0 0 0 0 0 0

00

word address 0, next bytes are data

0 0 0 0 0 0 0 0

00

00

control/status 1, no test modes or POR override

0 0 0 0 0 0 0 0

00

01

control/status 2, no alarm/timer flags or interrupts

0 0 0 0 0 0 0 0

00

02

set seconds, clear voltage low detector

0 1 0 0 0 1 0 1

45

03

set minutes to 45

0 0 0 1 0 1 0 0

14

04

set hours to 14

0 0 0 1 0 1 1 0

16

05

set days to 16

0 0 0 0 0 1 0 1

05

06

set weekdays to Friday, Monday is day 1

1 0 0 0 0 1 1 1

87

07

set month to 7 and century bit to 1

0 0 0 0 1 0 0 0

08

08

set years to 08

1 0 0 0 0 0 0 0

80

09

disable minute alarm and reset to 00

1 0 0 0 0 0 0 0

80

0A

disable hour alarm and reset to 00

1 0 0 0 0 0 0 0

80

0B

disable day alarm and reset to 00

1 0 0 0 0 0 0 0

80

0C

disable weekday alarm and reset to 00

1 0 0 0 0 0 0 0

80

0D

set frequency out to 32768 Hz e.g. for tuning

0 0 0 0 0 0 0 0

00

0E

timer switched off

generate

I

2

C stop condition

12.2 Alarm

It is possible to program several types of alarm. Let’s take the example to set an alarm
such that always 15 minutes past the hour the alarm flag AF is set and an interrupt
generated.

Table 6.

Setting the alarm

Sequence of commands / data to be sent

Binary (BCD)

HEX

Register
Address

Comments

generate

I

2

C start condition

1 0 1 0 0 0 1 0

A2

I

2

C slave address, write

Advertising
This manual is related to the following products: