Calendar/clock chapter 7 – Remote Processing RPC-2350 User Manual

Page 41

Advertising
background image

CALENDAR/CLOCK

CHAPTER 7

7-8

CHAPTER SYNOPSIS

Ž

Initializing and using the RTC

Ž

Y2K and Y2.4K issues

Ž

Using clock interr upts

DESCRIPTION

CALEND AR/CLOC K CHAPTER 7

The RPC -2350 has a battery backed Calendar/clock.
When used in conjunction with the DATE$ and TIME$
commands, the current date and time can be set and
read. It is accurate to 1 minute/month at 25°C and is not
adjustable.

The clock data sheet is in the applications disk. See
R T C 72 4 12 . P D F .

SETTING DATE AND TIME

The clock must be turned on before it is used. This need
be done only once. To turn on the clock, type:

CONFIG CLOCK 1

The date and time can be set while running a program or
in the immediate mode. Date and time are treated as
strings and not numbers. T o set the date and time:

date$="04-19-99"
time$="13:56:00"

T o r et r ie v e d a te a nd ti m e a s pa r t o f a p r o gr a m :

2000 DA$ = DATE$(0)
2010 TI$ = TIME$(0)

You can also print the d ate and time in the imm ediate
mode:

pr time$(0)
13:56:03

YEAR 2000 AND BEYOND

The clock on the RPC-2350G is year 2000 compliant
under the following condition:

Date is always returned as the last two digits of the
year. The first two digits, “19" or “20" must be
progr amm ed into your system. As of the tim e this
manual was wr itten, this required a quick check on
the year . If it w as not “ 99", then you assum ed it
was some tim e in the 20' s.

The clock will roll over on December 31, 1999 at
23:59: 59 to January 1, 2000 with no problem s.

CAM BASIC operating system does not use or need any
real time clock values for its operation. A clock is not
needed in order for CAMBASIC to operate.

The cloc k compe nsates for leap year in 2000. Should
you expec t this produc t to work into the 22nd ce ntury, it
will add a leap day in the year 2100 also. This, of
course, is not supposed to happen until the year 2400. If
you think your program will be working in the year
2100, you will have to compensate for this by resetting
the date when read as Februa ry 29, 2100 to M arch 1,
2100.

CLOCK INTERRUPTS

The RT C m ay be pr ogram med to ge nerate inte rrup ts at 1
second, 1 minute, or 1 hour intervals. L onger interrupt
i nt e rv a ls a re c on v en ie n t e s pe c ia l ly w he n O N T I C K
interrupts are running.

An interrupt is generated when the real time clock
counters increment the unit of time selected for the
interrupt interval. M ost of the time, the first interrupt
will be shorter than the interval period selected. For
example, suppose you w ant to interrupt every minute. If
the real time clock' s seconds wer e at 45 , the fir st
interrupt will occur in 15 seconds. Interrupts will then
occur e very m inute. Oper ation is similar for hour ly
interrupts.

The cloc k is progr amm ed to interr upt at specific
intervals in so ftware . Se e CL OCK 1.BA S for exa mple
p r o gr a m .

Jumper W 10 to enable interrup ts.

Advertising