<
065% .KPG %%& &GEQFGT
&'/10564#6+10 241)4#/5 %QPVKPWGF
SPI Operation
The serial port of the Z86229 may be configured to operate
as an I2C or SPI interface. The Z86229 always acts as the
slave device with the master generating the required clock
and input data signals. Two C language programs available
from ZiLOG enable a PC to perform as the I2C or SPI master
device of an application. The PC communicates with the
Z86229 through it's parallel port. These programs are not
intended as examples of how to program the application, but
are only provided as a means of illustrating the serial control
process.
The two programs available, SEROUT and SCRIPT, are the
SPI equivalent to the I2C programs IICO and SCRIPTI, re-
spectively.
SEROUT Program
This program sends one byte to the Z86229 without check-
ing the status of the READY bit. The program returns the
contents of the Serial Status (SS) Register after the com-
mand has been entered. When the program is active the
screen displays:
SPI Command Byte >
SPI Command Byte
The user may enter any valid one-byte command, such as
00h (NOP), and then hit the ENTER key. The screen then
displays the byte entered and the SS register contents as fol-
lows:
SPI Byte = 00
SPI Return Val = 83h
The illustration above shows the NOP command was en-
tered. The SS register contents, 83h, indicates that the RDY,
ZiLOG
FLD, and LOCK bits are “ones”. This condition indicates
that the serial port is ready for further input, that the input
video signal was in Field 1 at the time the status was read,
and that the part is operating in the video-lock mode.
When this program is used, only a modified version of the
RESET can be used. It is entered as two, one-byte com-
mands (FBh and 00h).
The SEROUT program is exited by entering a Control C
(^C) character.
Script Program
This program is designed to send any number of one or two-
byte commands to the Z86229. The list of commands to be
executed are contained in Script files that have the extension
.SER. The Script files used with the I2C version, SCRIPTI,
can be used with this program.
The program is invoked by typing:
SI File_name<ENTER>
Note: Enter the file_name without the .SER extension.
The screen displays:
EEG CCD2 Serial Interface Script Player
Version x.xx
Script File Done
When all the commands in the file have been successfully
sent to the Z86229, the PC returns to the system prompt.
The program checks the RDY status before sending each
byte. If, during the entry of a command, the RDY bit is not
found to be a “one”, the program reports the contents of the
SS register and then continue checking for RDY.
24'.+/+0#4;
&5