Rpbasic-52 programming guide, Assembly language interface – Remote Processing BASIC 52 User Manual
Page 15

RPBASIC-52 PROGRAMMING GUIDE
1-12
watc hdog t imer may be nec essary to resta rt the ca rd.
Make sure call waiting is disabled.
ON LINE Multitasking
O N L I N E is u se d to d e te c t c h a ng e s in a li n e. A n
interrupt is generated every time a line goes high or
low. Use this c omm and to detect ch anges in safety
interlocks, level switches, or process command
switches. Using this multitasking statement saves
code and time because checking is done
automatically in the background. A line must be
high or low for a m inimum of 5 ms to ensu re
detection to another state. Up to 8 lines can be
monitored at one time.
This command is re-entrant, meaning when a routine
is long enough and change interval short enough the
interrupt is called twic e. When there is this
potential, the first part of your prog ram should
branch to routines that handle high and low line
conditions. Use the LINE function to return the
current status of a line.
ON CO UNT can be used to expand the number of
line changes. Simply specify a count o f 1. A n
i n te r ru p t i s ge n e ra t ed w h e n t h e l i ne g o es l ow .
Program execution slows down by up to 5% when
all ON C OUN T and O N LIN E statem ents are
enabled.
ON COUN T Multitasking
Up to 65,535 pulses can be counted on any one of
eight lines. A line m ust be both low and high for a
minimum of 5 ms to ensure counting. Maximum
reliable counting rate is 95 Hz.
Counters spe cified in this statem ent are software
counters only. It is not related to any hardw are
counters on the card.
A num ber of syntaxes a llow simp le counting to
interrupt generation when a nu mber of cou nts is
reached.
The number of counters can be increased by using
ON LIN E. Counting rate must be very slow (less
than 1 0 time s/seco nd) to e ffectiv ely use this m ethod .
A counter increments when a line is low. Use the
LINE function to read the status of a line.
Program execution slows down by up to 5% when
all ON C OUN T and O N LIN E statem ents are
enabled.
Assembly Language Interface
Assembly language programs must be placed in the
RPBASIC-52 EPRO M. When using the Basic,
assembly language program s should start at address
6 0 0 0H o r hi g he r , u p to 7 F FF H .
Norm ally a 3 2K E PRO M is u sed to s tore R PBA SIC.
A 64K EPR OM m ay be used provided a
modification is performed. R efer to your hardw are
manua l under ASSEMBLY LANGUAGE INTERFACE
for information.
Documented assembly language interface calls listed
in the Intel MCS BASIC-52 Users Manual will not
work with RPB ASIC-52. This is because
RPBASIC-52 has be reassembled and code shifted
around.
Assembly language development environment
An econ omical w ay to develop ment asse mbly
language pro grams and still keep RPB ASIC-5 2 is to
use an EPROM emulator. These are available from
several sources.
Parallax Inc (916) 721-8271
JDR Micro Devices (800) 538-5000
Model typ es frequently cha nges, so it is best to
conta ct thes e com panie s for the latest in forma tion.
Generally, these cards connect to the parallel port on
a PC. Do wnloading a program is g enerally unde r 1
second.
The wa y programs are develope d would be to
remove the RPBASIC-52 EPROM and read it by an
EPROM programmer. Save the file.
Install the EPROM emulator into the card. Then,
load in both the RPBASIC-52 binary file and your
assembly language bin ary file using the softw are
provided by the emulator.
Assembly language routines are accessed using the
Basic CALL command.
Another de velopme nt method is to use an In-Circu it-
Emulator (ICE). Which type you use depends upon
the processor type and your budg et.