SCSI Examples
              Copyright 1996 Warren Block (wblock@rapidnet.com)
                   Excerpted From The A4000 Hardware Guide
      (The full Guide can be found on Aminet as hard/misc/a4khard.lha.)

-----------------------------------------------------------------------------

  It seems that the SCSI bus is one of the most misunderstood aspects of
  connecting hard drives and other peripherals to the A4000 (or, for that
  matter, any other Amiga model). This section of the guide is an attempt to
  provide some simple examples of proper SCSI device connections. Please note
  that in the following section, and in the Guide as a whole, I have used the
  common term "controller" when referring to disk adapter boards, although
  the more accurate description for both SCSI and IDE would be "host
  adapter."

  Definitions

  Since understanding SCSI requires a background in the jargon, a few basic
  definitions might be helpful:

    Asynchronous Mode

    The default transfer mode for SCSI, where a data word is sent, then an
    acknowledge for that word must be received, then the next word is sent.

    Synchronous Mode

    Synchronous mode reduces transfer overhead by not requiring an
    acknowledge immediately after the transfer of each data word. A familiar
    comparison would be the modem transfer protocols of XModem (async) and
    ZModem (sync). Many older devices do not support sync mode.

    SCSI or SCSI-1

    This is the original standard. In the default async mode, the fastest
    theoretical transfer rate is 2.5 megabytes per second, doubling to 5
    megabytes per second in sync mode. Total length of the SCSI bus cannot
    exceed six meters.

    SCSI-2

    An update and revision to SCSI-1 which adds a lot of features including
    an extended command set. Most CD-ROM drives that are double-speed or
    faster are SCSI-2. Unless SCSI-2 devices support Fast Sync mode (see
    below), they perform at the same speeds as SCSI-1.

    Fast Synchronous Mode

    When SCSI-2 was defined, an optional new sync mode was included. Fast
    Synchronous allows SCSI devices to run at double their normal synchronous
    rate. For Fast SCSI-2, the rate is 10 megabytes per second. (Maximum
    cable length is halved to three meters, though.)

    Disconnect/Reselect

    Some SCSI devices are smart enough to know that certain operations will
    take a long time, and can release the SCSI bus until they're done with
    those operations. During this time, the bus can be used by other devices.
    An example would be a tape drive doing a disconnect while seeking to a
    different location on a tape. Many older devices (or drivers) do not
    properly support disconnect/reselect operation; often, hard disk drives
    with this problem will cause lockups when copying files to another drive.

    Wide SCSI, Differential SCSI, and SCSI-3

    SCSI transfers data over an 8-bit-wide data path. A variation called Wide
    SCSI uses a 16-bit-wide data path via an additional cable, potentially
    doubling transfer rates. SCSI-3 is essentially Fast Wide SCSI-2 using
    only one cable. Another variation is differential SCSI, which uses
    differential signal cables to provide a total bus length of up to 25
    meters. None of these variations will be described in any detail here,
    since there don't seem to be any Amiga implementations of controllers for
    them yet. Adapters are available to connect these devices to normal SCSI
    controllers, though, so it is possible to connect them to the Amiga.

  Compatibility

  SCSI devices are backwards-compatible. That is, you can connect a SCSI-1 or
  SCSI-2 hard drive to a Fast SCSI-2 controller, or you can connect a Fast
  SCSI-2 drive to a SCSI-1 or SCSI-2 controller. A Fast controller can't make
  a SCSI-2 drive go any faster than SCSI-2, but it will work.

  Termination

  SCSI bus systems require an impedance-matching terminator circuit at each
  end of the bus for reliable operation. Many people find termination to be
  complex, but the subject can be simplified a great deal by remembering one
  simple rule: the SCSI bus needs to be terminated at both ends, and *only*
  at the ends.

  The most common mistake in SCSI termination is assuming that the SCSI
  controller itself doesn't count; in fact, it does count as a device, and
  the termination rules apply to it just like other devices. Many Amiga
  controllers have the termination resistors soldered into place, under the
  assumption that only internal or only external SCSI devices will be
  attached. If both internal and external devices are to be used, it is
  necessary to remove these resistors. Soldered-in terminators can be
  desoldered or simply cut out. Sockets may be soldered in their place to
  provide the greatest versatility, or you can just use external terminators.

  Terminating resistors are usually SIP (Single Inline Package) resistor
  packs; they look like an integrated circuit that's been cut in half
  lengthwise. SIPs can be yellow, blue, black, or red, and there may be one,
  two, or three of them. External terminators look like a connector with no
  cable attached, and can be found in Centronics 50-pin, DB25, and
  high-density 50 configurations.

  All of the termination schemes described so far are known as "passive"
  terminators. Electronically, they connect each signal pin to +5V through a
  220 ohm resistor, and to ground through a 330 ohm resistor. This voltage
  divider circuit provides impedance matching for the SCSI bus.

  The alternative to a passive terminator is an "active" terminator, which
  connects each of the SCSI signal pins through a 110 ohm resistor to a
  precision +2.85V regulator (an LT1086CT, for example) which is powered by
  +5V. Active terminators are superior to passive terminators simply because
  they are active; unlike the fixed resistors in a passive terminator, the
  active terminator's voltage regulator will track varying voltages and
  properly terminate the SCSI bus. Active terminators can cure many problems
  with unreliable SCSI devices. Many devices with active termination allow
  enabling or disabling it with a single switch or jumper.

  The only disadvantage is that active terminators tend to cost a bit more
  (Dalco sells them for between twenty and forty dollars). Active termination
  chips are made by Dallas Semiconductor and Texas Instruments.

  Mixing terminator types may cause data errors, so it's not advised.

  Termination Power

  Terminator power (+5V) needs to be supplied on pin 26 of the 50-pin
  IDC header. Some SCSI devices do not supply this power; many have jumpers
  to enable or disable it. So it is possible to have a proper termination
  setup, but no power provided to the terminators. As you might expect, this
  will cause problems. Make sure that at least one device is supplying
  termination power to the SCSI bus, preferably the controller, since
  external devices may be turned off, which would deprive the whole bus
  of termination power. You may find that having the devices at both ends of
  the bus supply termination power makes for more reliable operation, since
  the terminators don't have to deal with the voltage drop of a long cable.

  Cable Configurations

  Internal SCSI devices are usually connected with 50-conductor ribbon cable.
  50-pin IDC (Insulation Displacement Connector) headers are crimped onto the
  cable for each device to be attached. "Stub" cables of no more than ten
  centimeters off the main cable are allowed by the SCSI standard, but it's
  better to avoid them altogether by running the cable direct from one device
  to the next, with no branches off the main bus at all.

  External SCSI device cables can use several connectors: Centronics 50-pin,
  DB25, or high-density 50-pin (commonly, but imprecisely, referred to as
  "SCSI-2", since many Fast SCSI-2 adapters use this type of connector).
  Adapter cables may have any combination of these three basic types.

  The SCSI standard states that the total length of the SCSI bus, including
  internal and external cable, must not exceed six meters. For Fast SCSI-2,
  the limit was reduced to three meters. In practice, some devices and cable
  combinations may limit this severely, particularly poorly-constructed
  cables or those with DB25 connectors (since Apple created the DB25
  "pseudo-SCSI" cable by simply discarding all those "extra" grounds that
  helped make SCSI capable of running long distances in the first place).
  Conversely, some SCSI bus implementations can go farther than the standard
  suggests.

  SCSI Address Numbers

  Each SCSI device (including the controller) has an address between 0 and
  7 assigned to it by the user. These numbers are usually set as a binary
  number with three jumpers or switches. Controllers often have no jumpers,
  either requiring software to change their address, or simply not being able
  to change it at all. Standard Amiga controllers of either type default to a
  SCSI address of 7.

  The rules regulating addresses are pretty simple: each device must have
  a unique address. (There is no physical "order" in which the addesses must
  occur; you can use any order or combination of numbers, as long as there is
  only one device with a given address.)

  Since most Amiga controllers scan the SCSI bus for bootable devices
  starting with address 0 and proceeding to address 7, it is advised that you
  assign address 0 to the boot hard drive, and set "HiID" or "LastDrive" to
  "On" for this drive in the Rigid Disk Block (RDB). This will prevent the
  system from looking for other hard drives with a higher boot priority,
  making for the quickest booting possible, and preventing the system from
  trying to boot off of a higher-numbered CD-ROM drive. (Check the Aminet
  disk/misc directory for RDB utility programs.)

  LUNs

  Logical Unit Numbers provide a way to access more than one device at a
  given SCSI address. For example, some Adaptec SCSI-to-MFM adapter boards
  like the 4000A could control two MFM hard drives. However, the 4000A board
  used only a single SCSI address; to access each drive, a secondary number--
  the LUN--was used: 0 for the first drive and 1 for the second. With modern
  SCSI devices, LUNs are relatively rare, with the exception of CD-ROM
  changers. These devices often use an LUN to select which CD will be loaded.
  In an Amiga mountlist, LUNs are specified in the Unit parameter: the
  address is the "ones" digit, the LUN is the "tens" digit, and the SCSI
  controller is the "hundreds" digit. With only one SCSI controller, a device
  at address 5, LUN 1 would have a Unit number of 015 (or just 15).

  Specific Troublesome Devices

  There are a couple of devices out there that are almost guaranteed to be
  troublemakers on a SCSI bus. Since this section of the Guide is also
  distributed as the SCSI Examples document, these are included here even
  though they don't necessarily apply to the A4000.

  1. The NEC CDR-36 CD-ROM drive. This is a single-speed (150K/second)
  external drive with a top-loading case. It may be helpful to disable
  termination on this drive and use an external terminator; it may not.
  If odd problems persist, check that pin 17 on the DB25 connector on the
  cable is not grounded. If it is, disconnect that pin, or replace the cable.

  2. A3000 problems. The A3000's internal SCSI controller has a few minor
  flaws that can be problematic.

     A. The Western Digital 33C93 SCSI chip itself: revision 04 of this chip
     has some bugs that usually show up when a CD-ROM or tape drive is
     attached, and revision 08 fixes them.

     B. The DB25 used as an external SCSI connector on the A3000 can cause
     problems. Use only short, high-quality SCSI cables attached to this
     connector, or run 50-pin ribbon cable from the internal connector.

     C. Termination. Various A3000s seem to have come with no terminators,
     soldered-in SIPs, or even sockets. Check the motherboard controller
     termination, and follow the guidelines laid out in the Termination
     section above.

     D. Many A3000s had a manufacturing flaw which resulted in terminator
     power not being supplied at the external SCSI connector. The easiest way
     to test this is with an external terminator with an LED indicator.
     Otherwise, you'll need to check pin 25 of the A3000 DB25 SCSI connector
     for +5V (the shield around the connector provides an easy ground test
     point). If no voltage is supplied on pin 25, diode D800 (or D801, this
     may vary depending on motherboard revision) is reversed inside the
     A3000. Unsolder and replace it (this should be a 1N34 type, although a
     1N5817 should work and might be more suitable). The motherboard silk
     screen is likely to be wrong as well, so ignore it.

  3. Some GVP controllers. For a while, it seemed like all the email I
  received was from owners of GVP controllers. For many of these people,
  upgrading to the Guru ROM solved their problems. Disabling termination on
  some of these boards is also non-trivial; Guru ROM author Ralph Babel
  explains:

  "Most GVP cards use only two 10-pin SIP terminators _plus_ two extra
  resistors (SMD, except for the very first revisions of the Series-II hard
  card) for the parity line for a total of 17 terminated lines (they leave
  out the RST line)."

  The use of SMD (Surface Mount Device) resistors complicates disabling
  termination on these boards. It will be simplest for many users to
  reorganize the SCSI bus so that the controller is on one end.

  GVP's current technical support number is 215-633-7711.

  Example SCSI Bus Setups

  These examples show connections to the A2091 controller (see Drives/
  A2091 Reference), but the connections for other controllers will follow the
  same standard.

  In Example 1, the 200M hard drive is used as the boot drive, and the "HiID"
  flag is set to "On" in this drive's Rigid Disk Block. (The HiID flag may be
  called by another name, like LastDrive or HighDrive.) For examples 2 and 3,
  the 540M drive is used as the boot drive, and the HiID flag is set in that
  drive's RDB.

  Example 1: 2091 controller, internal 200M SCSI-1 hard drive. Cable
             connections are 50-conductor ribbon.
     ________________        ________________
    |      2091      |      |  200M SCSI-1   |
    |   Terminated   |------|  Terminated    |
    |   Address 7    |      |  Address 0     |
    |________________|      |________________|


  Example 2: 2091 controller, internal 200M SCSI-1 hard drive, internal 540M
             Fast SCSI-2 hard drive. Cable connections are 50-conductor
             ribbon. The SCSI-1 drive has been renumbered as address 1, and
             the new Fast SCSI-2 drive is now set at address 0 and used as a
             boot drive, to provide better performance on the system
             partitions. (Even though it will only be accessed at SCSI-1
             rates, it is a newer drive, and will probably have significantly
             better transfer rates than the older 200M drive.) Additionally,
             the newer drive will likely have the more desirable active
             termination on-board.
     ________________        ________________        ________________
    |      2091      |      |  200M SCSI-1   |      |540M Fast SCSI-2|
    |   Terminated   |------| Not Terminated |------|  Terminated    |
    |   Address 7    |      |   Address 1    |      |  Address 0     |
    |________________|      |________________|      |________________|


  Example 3: 2091 controller, internal 200M SCSI-1 hard drive, internal 540M
             Fast SCSI-2 hard drive, external SCSI-2 CD-ROM drive. The cable
             from the CD-ROM drive to the A2091 is a Centronics 50-pin to
             DB25 adapter cable, and the internal cables are 50-conductor
             ribbon. An active terminator is attached to the last available
             external SCSI connector on the CD-ROM drive. Note that the
             terminating resistors on the A2091 have been desoldered or
             broken out so that the SCSI bus is terminated only at the ends
             (the CD-ROM and the 540M drive).
   ________________
  | CD-ROM SCSI-2  |
  |   Terminated   |---. External cable connected to A2091
  |   Address 4    |   | external SCSI DB25 connector
  |________________|   |
       External        |
                       |
           ____________|___        ________________        _______________
          |      2091      |      |  200M SCSI-1   |      |540 Fast SCSI-2|
          | Not Terminated |------| Not Terminated |------|  Terminated   |
          |   Address 7    |      |   Address 1    |      |  Address 0    |
          |________________|      |________________|      |_______________|