Chapter 2
Startup and Shutdown
2-11
Loading the Protocol
Since the entire protocol is longer than the 2K dual-port RAM can handle
in one operation, your driver must download the protocol file in multiple
iterations.
Refer to the algorithm below for loading the protocol into the K
T
x card.
1. Load one block of protocol cod
e
through the dual-port RAM and
into the Z80 RAM. Start at :0080h (do not go past :07FFh).
The maximum byte size is :0780h (1920 decimal).
2. Load size of bloc k
into the Size Word locations. Low byte is :0072h;
high byte is :0073h.
3. On the first pass, release Z80 by writin
g 01h to byte :0802h.
On all subsequent passes, reset handshake byte :0075h t
o
00h to
signal the K Tx’s Z80 that your driver has loaded the next block
into the dual port.
4. Wait for the loader to return handshake byte :0075h t
o
01h. The Z80
is loading the block of protocol code into its RAM.
5. Check error byte :0074h.
Status Code Meaning of Code
00h
No Error Detected
01h
Block Too Large
02h
Z80 RAM Too Full For Next Block
6. Correct any errors by fixing the problem and then resetting the Z80
and restarting.
Note: If you want to know how many bytes you had loaded,
calculate the number of bytes loaded so far (
Total Word) by
checking bytes :0070h (low byte) and :0071h (high byte).
7. Repeat the loading blocks procedure (steps 1–6) until finished.
8. Reset the K T
x card by writin g 01h to byte :0803h.
Refer t o
to see what each address will contain once you have
completed the download.