
2-26
SYM53C876/876E Data Manual
Functional Description
SCSI Functional Description
halting.
n
In the case of Transfer Control Instructions,
once instruction execution begins it continues
to completion before halting.
n
If the instruction is a JUMP/CALL WHEN/
IF <phase>, the DSP is updated to the
transfer address before halting.
n
All other instructions may halt before
completion.
Sample Interrupt Service Routine
The following is a sample of an interrupt service
routine for the SYM53C876. It can be repeated if
polling is used, or should be called when the
INTA/ (or INTB/) pin is asserted if hardware
interrupts are used.
1. Read ISTAT.
2. If the INTF bit is set, it must be written to a
one to clear this status.
3. If only the SIP bit is set, read SIST0 and
SIST1 to clear the SCSI interrupt condition
and get the SCSI interrupt status. The bits in
the SIST0 and SIST1 tell which SCSI
interrupts occurred and determine what
action is required to service the interrupts.
4. If only the DIP bit is set, read the DSTAT to
clear the interrupt condition and get the
DMA interrupt status. The bits in the
DSTAT tells which DMA interrupts occurred
and determine what action is required to
service the interrupts.
5. If both the SIP and DIP bits are set, read
SIST0, SIST1, and DSTAT to clear the SCSI
and DMA interrupt condition and get the
interrupt status. If using 8-bit reads of the
SIST0, SIST1, and DSTAT registers to clear
interrupts, insert a 12 CLK delay between the
consecutive reads to ensure that the interrupts
clear properly. Both the SCSI and DMA
interrupt conditions should be handled before
leaving the ISR. It is recommended that the
DMA interrupt is serviced before the SCSI
interrupt, because a serious DMA interrupt
condition could influence how the SCSI
interrupt is acted upon.
6. When using polled interrupts, go back to step
1 before leaving the interrupt service routine,
in case any stacked interrupts moved in when
the first interrupt was cleared. When using
hardware interrupts, the INTA/ (or INTB/)
pin is asserted again if there are any stacked
interrupts. This should cause the system to re-
enter the interrupt service routine.
Chained Block Moves
Since the SYM53C876 has the capability to
transfer 16-bit wide SCSI data, a unique situation
occurs when dealing with odd bytes. The chained
move (CHMOV) SCRIPTS instruction along
with the Wide SCSI Send (WSS) and Wide SCSI
Receive (WSR) bits in the SCNTL2 register are
used to facilitate these situations. The Chained
Block Move instruction is illustrated in Figure 2-
8.
Wide SCSI Send Bit
The WSS bit is set whenever the SCSI controller
is sending data (Data-Out for initiator or Data-In
for target), and the controller detects a partial
transfer at the end of a chained Block Move
SCRIPTS instruction (this flag is not set if a nor-
mal Block Move instruction is used). Under this
condition, the SCSI controller does not send the
low-order byte of the last partial memory transfer
across the SCSI bus. Instead, the low-order byte
is temporarily stored in the lower byte of the
SODL register and the WSS flag is set. The hard-
ware uses the WSS flag to determine what behav-
ior must occur at the start of the next data send
transfer. When the WSS flag is set at the start of
the next transfer, the first byte (the high-order
byte) of the next data send transfer is “married”
with the stored low-order byte in the SODL regis-
ter; and the two bytes are sent out across the bus,
regardless of the type of Block Move instruction
(normal or chained). The flag is automatically