User`s manual

PK2100
4-8 s System Development
$
Refer to the Dynamic C manual for a discussion on memory
mapping and remote downloading and execution of code.
Downloading Code
A program may be downloaded to the PK2100 via a serial or other
communications link. A related problem is loading programs to EPROM,
RAM, or an external mass storage device for execution.
The basic method for downloading starts with writing a monitor program
that is burned into EPROM. This monitor program serves as a master
controller to load and start execution of the programs and to regain control
when the executed program finishes.
The monitor program must also gain control when the board is reset
through hardware, either by power-on, watchdog time-out, or the reset
key. An external hardware reset line may be installed to allow the
computer that is downloading the program to be able to force a hardware
reset of the PK2100. Connect Pins 2 and 3 on Jumper J11 to use the CTS0
line from the 6-pin phone jack to control external resetting of the PK2100.
However, the handshaking line for the RS-232 port will be lost. To be
safe, tie the /CTS0 line of the RS-232 port to ground to continue to use the
RS-232 port for communication.
Direct Programming of the Serial Ports
The Z180 Technical Manual and the Z80 SIO Technical Manual,
available from Zilog, Inc., in Campbell, California, provide detailed
information to plan extensive use of the serial ports and synchronous
communications. Z-World provides just a few low-level utility functions:
int sysclock()
int z180baud( int clock, int baud )
The sysclock function returns the clock frequency in units of 1200Hz,
as read from the EEPROM. The clock frequency was stored at location
108H at the factory. The z180baud function returns the byte to be stored
in CNTLB0 or CNTLB1, considering only the bits needed to set the baud
rate. The clock and baud rate must be specified in units of 1200Hz.
Thus, a 9.216-MHz clock is expressed by 7680, and 19,200 baud is
expressed by 16. The return value is 1 if the baud value cannot be
derived from the given clock frequency.
Each serial port appears to the CPU as a set of registers. Each serial port
can be accessed directly with the inport and outport library functions,
using the symbolic constants for Address 0009 in Table D-1, Appendix
D.