
REAL TIME CLOCK BASIC SECTION 7
Page 7-3
Other software type interrupts that require CPU
processing such as ONTICK, ON LINE, ON COUNT,
or ON KEYPAD are NOT active.
IDLE 1 will work with interrupt 0 only if a CONF IG
BAUD 1,. .. or ON ITR 0 statement w as previously
executed.
SQUARE WAVE OUTPUT
The real time clock can generate square waves in the
frequency range of 2Hz to 8192 Hz. Output is at J7-4.
Application progr am RT C-3. BAS gener ates outputs
based on a user selecte d input.
READING CLOCK SERIAL NUMBER
The real time clock has a unique serial num ber. This
serial number may be used in conjunction with a
program to protect against unauthorized copying.
The ser ial numbe r is rea d using RT C-4. BAS. This
example shows how the serial number may be read and
compared to determine if the software matches the
board. When used in conjunction with the HIDE
comm and, copying your product becom es virtually
impossible.
PROGRAMMABLE INTERRUPTS
The real time clock may be programmed to generate an
interrupt at a preset time. This time may be every
minute, hour, or day. Interrupts are similar to power
down modes described above except in this mode power
is always on.
Program RTC-5. BAS requests the hour, m inute, and
second the interrupt will occur. The hour , m inute, or
second may be “ignored” if desired.
NOTE: When real time clock interrupts use INT0 (J7-
3), COM 1 is not available.
The interrupt line can be brought to one of the lines on
J3. RPBASIC-52's ON LINE or ON COUNT
comm ands can be used to detect the interru pt.
APPLICATION PROGRAMS
The following programs are in the BASIC52 directory.
RTC-5.BAS has a routine for formatting time that may
be useful when using the DISPLAY command.
Name Function
RTC-1.BAS Initialize real time clock
RTC-2.BAS Set wake up time.
RTC-3.BAS Output square wave at J7-4
RTC-4.BAS Reads serial number and compares it
to number in program.
RTC-5.BAS Enables periodic interrupt based on
time.
1
Tadiran is in Port Washington, NY. Ph: 516 621
4980
Komentáře k této Příručce