NXP Semiconductors PCA2125 Alarm, Setting the alarm, Binary BCD, Register Comments Address

Page 27

NXP Semiconductors

 

 

 

 

 

UM10301

 

 

 

 

 

User Manual PCF85x3, PCA8565 and PCF2123, PCA2125

 

Table 5.

Setting the time and date

 

 

 

Sequence of commands / data to be sent

 

 

 

Binary (BCD)

HEX

Register

 

Comments

 

 

 

 

 

Address

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

generate I2C start condition

 

 

 

 

 

 

I2C slave address, write

1 0 1 0

0 0 1 0

A2

 

 

 

 

 

 

 

 

 

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 I2C 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

 

Comments

 

 

 

 

Address

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

generate I2C start condition

 

 

 

 

 

 

I2C slave address, write

 

1 0 1 0 0 0 1 0

A2

 

 

 

 

 

 

 

 

 

 

UM10301_1

 

 

 

 

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

User manual

Rev. 01 — 23 December 2008

27 of 52

Image 27
Contents Info Content Keywords Document informationAbstract Rev Date Description Contact informationNXP Semiconductors Revision historyIntroduction Features Address Register name Bit Register overview PCF8563Comparison Event counter modeComparison of six real time clocks FeaturesPower-on reset POR Power-on resetVoltage-low detector Oscillator Voltage-low detectionOscillator-stop detection Overview of internal and external oscillator capacitors Pierce Oscillator equivalent diagramOscillator frequency determining components UM10301 + C Parameter Value Unit Source Typical values for crystal and surrounding capacitorsOscillation allowance Using an external oscillatorCrystal and crystal selection Modes which don’t work Effect of temperature− f nom Capacitors and capacitor selection Accuracy Influences on time accuracy Oscillator tuning Oscillator tuning 10.1 PCF2123 Offset register Daylight Saving Time DST Century and leap year, Daylight Saving TimeCentury tracking Year and leap year trackingInitialization and setting of alarm and timer Initialization of the RTC and setting the timeBlock Diagram PCF8563 Register Comments Address AlarmSetting the alarm Binary BCDAlarm function Setting the timer Setting the timerRegister Lithium Primary cells Backup power supplyBackup circuit using primary lithium cell NiCd and NiMH secondary batteries Backup circuit using secondary cell NiCd or NiMH13.3 Capacitors Charging the backup capacitor BAS716 BAS116 BAV170 Diode selectionSome suggestions for diode D1 1N4148PCB layout guidelines PCB layout proposal for PCF8563 using leaded components Partial circuit switch down Protection diodes Hints to keep power consumption low0007 Rpmax as a function of bus capacitance 8473 ⋅ C bApplication diagram 2, SPI interface Application diagram 1, I2C-bus interfaceGeneral countdown timer behaviour First period inaccuracy when using the timerTimer delays Timer Source clock frequency Delay for n =Timer source clock Minimum timer period Maximum timer period First period delay for timer counter value nTiming requirements for I2C read and write I2C interface Block diagram I2C interface and Time countersSequence of events example Read Oscillator startup time Checking for oscillation TroubleshootingNo communication via I2C-bus Wrong time and date, wrong clock speed ReferencesTrademarks Legal informationDefinitions DisclaimersContents