User`s manual

PK2200 System Development s 41
Interrupt Handling for Z180 Port 0
Normally, a serial interrupt service routine would be declared with the
compiler directive:
#INT_VEC SER0
_
VEC routine
However, if you use the same serial port for Dynamic C programming,
your program has to be downloaded first with Dynamic C before the
address of the serial interrupt service routine is loaded into the interrupt
vector table. That is, the service routine must be loaded at run-time.
The following function loads the address of the service function into the
specified location in the interrupt vector table.
reload
_
vec (int vector, int(*serv
_
function)())
The #INT
_
VEC directive should not be used with this function. Once the
service routine has taken over, you cant debug your program in
DynamicC.
If you communicate with a serial device other than the PCs Dynamic C
programming port, your program has to make sure that the hardware is
properly configured before sending any messages. For example, when
using Z180 port 0 for serial communication with a modem, use the
PK2200s keypad to trigger serial port initialization. Without this trigger,
the modem may not properly communicate with the support software
because the initialization routine also sends initialization commands to the
modem.
When executable programs are generated either for EPROM or for down-
loading to RAM, there is no need for communication with DynamicC.
The compile-time directive #INT
_
VEC can then be used freely.
Remote Downloading
The PK2200 has the capability of remote downloading program code.
This allows units to be reprogrammed in the field, eliminating the need to
recall units for reprogramming or sending field service personnel to install
new software. In order to use the remote download feature, the PK2200
must have a serial link to the remote PC, either a direct RS-232 link or a
modem. The RS-232 connection is limited to several hundred feet.
Modems allow communication over virtually unlimited distances.
If you plan to use the remote download feature, make sure that the
PK2200 has enough memory to store future program revisions and data.
Refer to Dynamic C Technical Reference Manual for a detailed descrip-
tion of the remote downloading procedure.