beautypg.com

Figure9.4 target operation, Target operation – Avago Technologies LSI53C1010 User Manual

Page 205

background image

Loopback Mode

9-7

Figure 9.4

Target Operation

The program checks the SBCL register to determine if the selection is
with or without SATN/. This effects the next phase asserted by the target.
The desired phase is asserted by setting the MSG/, C_D/, and I/O bits
in the SOCL register while maintaining BSY/. This would be MESSAGE
OUT if SATN/ was sampled asserted or COMMAND if SATN/ was
sampled deasserted in the SBCL register. At this point, selection with
ATN/ is now complete. The SIP and DIP bits in the ISTAT register are
polled for a single step interrupt and any others that may have occurred.
Reading the SIST0, SIST1 and DSTAT registers clears these interrupts.
The single step interrupt is cleared by reading the DSTAT register. Other
interrupts may occur, depending on the particular settings in the SIEN
and DIEN registers. You can safely clear all interrupts, as any pending
interrupts would inhibit the execution of further SCRIPTS instructions.
The example in

Figure 9.4

uses a polled interrupt procedure. Hardware

interrupts are handled in an interrupt service routine.

The Start DMA operation bit of the DCNTL register is set so that the
Block Move SCRIPTS instruction begins execution. This Block Move
instruction transfers the identify message associated with Selection with
ATN/ to the target. A delay is inserted to ensure that the processor has
time to fetch the instruction.

The next section of code,

Figure 9.5

, uses loopback mode to transfer

bytes. Although this example can be used with the rest of the sample

/*TARGET, check for ATN*/
if (siop_reg[SBCL] & 0x08) {

/*TARGET, assert BSY, and MSG OUT*/

siop_reg[SOCL] = 0x26;
/*Self-Selection with ATN is now complete.*/
/* Wait for single step interrupt*/
while ((siop_reg[ISTAT] & 0x03) ==0);
/*Clear all interrupts*/
junk = siop_reg[SIST0];
junk = siop_reg[SIST1]
junk = siop_reg[DSTAT];
/*Start Script Block Move instruction*/
/*to send Identify Message to “Target” */
/*MOVE 1, identify_buf, WHEN MESSAGE OUT*/
siop_reg[DCNTL] |= 0x04;
/*Wait for SCRIPTS routine to finish using host bus*/
delay(1);

This manual is related to the following products: