Remote Processing RPC-210 User Manual

Page 35

Advertising
background image

REAL TIME CLOCK

BASIC

SECTION 7

Page 7-1

INTRODUCTION

R E A L T IM E C L O C K

S E C T IO N 7

A real time clock (RTC) incorporates an industry
standard DS1287 with several enhanced features. Of
note, these are a unique serial number, century register,
power elapsed timers, and power cycle counter.

The RT C is batter y backed an d also backs up RAM in
U4. An additional 114 bytes of RAM are available in the
clock chip itself.

The clock can generate an interrupt or wake up the CPU
from low power mode at periodic time intervals or
preset time.

This section of the man ual addre sses many of the par ts
features and capabilities. However, not all are
discussed. Review the data sheet, 1689-93. PDF , for
more inform ation.

ADDRESSING

The RT C' s base addr ess is 0A100 H. The par t is
accessed using the LINEB commands and. C lock
registers ar e accessed by adding 0A 100H to the addr ess
shown in the data sheet.

Review the application programs in the BASIC52
subdirectory for programming examples. RTC-1.BAS
accesses most all functions. It also has subroutines for
formatting data.

Note that the re ar e two re gister bank s in this chip. Both
b a nk s al lo w a cc e ss to ti m ek e ep in g , c on tr o l, a n d s o m e
RAM . Bank 0 has an addition al 64 bytes of R AM while
bank 1 has serial number, extended control, and other
timers. Bank control is through register A, bit 4. See
page 10 of the 1689-93.PDF file for register A
information.

PROGRAMMING NOTES

The optional RTC oscillator is turned off and date, time,
and counters are reset to zero as shipped from the
factory. This is to conserve battery power.

The D S1689 re al time clock has sever al register s used to
control and access var ious functions and capabilities.
The data sheet, 1689-93.PDF, has much more
information.

This section describes some of the more commonly used

capabilities of the clock.

The cr ystal used is 12. 5 pf. Bit 5 must be set in
extended control register 4B. This bit is set in
RTC-1. BAS demonstration program at line 1000.

SETTING DATE AND TIME

Date and time are set while running a progr am or in the
immediate m ode. D ate and time are treated as num bers,
not strings. To set date and time:

DATE 0,1,5
TIME 13,23,43

Date is January 5, 2000. Time is set to 1:23:43 PM.

The clock has a cen tury counter loca ted at I/O addr ess
0a148h. It is in the clock’s exte nded re gister bank . T his
byte may be set or read.

Date and time are set in RTC -1.BAS.

Daylight savings time adjustment
The RTC may be program med for automatic daylight
savings time correction. When bit 0 in register B (at
address 0A10BH) is set, the hour advances at the
approp riate tim e on the first S unday in A pril and falls
b a ck o n t he la s t S u nd a y i n O c to b er . S e e 1 6 89 - 93 . P D F
data sheet, page 11 for mor e information.

BATTERY LIFE

The batter y included on tw o RPC -210 ver sions is, in
theory, good for 10 years of power off backup. 1 In
practice, you will achieve less than 4 to 6 years of life.
This is true of any lithium button cell. Factors that
cause life to decrease are elevated temperatures, high
and low humidity. A batteries' self discharge doubles
when its environment temperature change s from 25

/

C to

50

/

C. This alone r educes batte ry life fr om 10 ye ars to

5. Lower temperatures reduce self discharge rate.

Low h umidity pr omotes the evapor ation of electr olyte
from the battery . H igh humidity helps dischar ge it.

If battery life is not long enough you can remove the
existing battery and replace it with a 3V lithium type. A
Tadiran

1

model TL-5276/ SL is a utility meter battery and

will, in theor y, pr ovide backup for ov er 100 year s.

Battery current is about 5 micro-amps with board power
off.

Advertising