Getting Started in CAMAC

Presented here are selected topics that have been addressed with replies from camac-support@fnal.gov. This information does not replace the documentation provided with each CAMAC product, but rather is meant as an aid in deciding which CAMAC product may be useful, and help new users select and acquire the right hardware and software.

Since much of the new activity in CAMAC at Fermilab has been with IBM clone PC's used as the host computer with Jorway controllers, those systems will be the primary focus of this information.

Contents

 

General Information

Information about the CAMAC standards for both hardware and software is contained in a book published by The Institute of Electrical and Electronics Engineers, Inc called CAMAC Instrumentation and Interface Standards, copyrighted in 1982. The Library of Congress Catalog Number is 8185060. The ISBN number is 0-471-89737-X.

For an introductory overview of CAMAC, an application note is available from the LeCroy Corporation (http://www.lecroy.com/ ) called AN-33 "AN INTRODUCTION TO CAMAC".

 

Selected Timings

There is a difference in single word and block transfer performance depending on the combination of operating system, Jorway interface, and CAMAC crate controller. Below are timings for several combinations.

Windows NT 4.0

The following data rates were measured between a Fermilab (CAMAC) Bench Mark Module and a 100MHz Pentium system using an Adaptec 2940 SCSI host adapter card and the SCSI Jorway 411S. We measured rates for Serial CAMAC using a Kinetic Systems K3952 Type L-2 Serial Controller, and for Parallel CAMAC using a Jorway Model 71B Crate Controller.

The timing test program called cfubc/csubc in a tight loop, using buffers that ranged in size from 1 to 32768 bytes. Times were used from the C time function. We found data rates could be described by a set-up time and a rate in kilobytes per second. The 0.8 millisecond setup time was independent of the variables used.

 

Jorway 411S Interface

Crate Controller

16 bit

(kbyte/s)

24 bit

(kbyte/s)

Jorway 71B Type A-2 (Parallel)

952

1,364

K3952 Type L-2 (Serial)

370

545

Support for the Jorway 73A was added after the first release of the Windows NT CAMAC driver, so timings were not included in the original documentation from which this information is taken.

 

Linux 2.0.29

The following data rates were measured between a Fermilab (CAMAC) Bench Mark Module and a 100MHz Pentium system using an Adaptec 2940 SCSI host adapter card. In testing the SCSI Jorway 411S, we measured rates for Serial CAMAC using a Kinetic Systems K3952 Type L-2 Serial Controller, and for Parallel CAMAC using a Jorway Model 71B Crate Controller.

The timing test program called cfubc/csubc in a tight loop, using buffers that ranged in size from 2 to 32200 bytes. Times were used from the C time function. We found data rates could be described by a set-up time and a rate in kilobytes per second. The 0.2 millisecond setup time was independent of the variables used.

 

Jorway 411S Interface

Crate Controller

16 bit

(kbyte/s)

24 bit

(kbyte/s)

Jorway 71B Type A-2 (Parallel)

773

1,289

K3952 Type L-2 (Serial)

330

635

 

Jorway 73A Interface

 

16 bit

(kbyte/s)

24 bit

(kbyte/s)

 

1,558

1,538

 

CAMAC Hardware

Jorway CAMAC Interfaces

The two SCSI CAMAC interfaces supported by PC-CAMAC libraries are the Jorway 411S and the Jorway 73A. The Jorway 411S is a QBUS Jorway 411 that has been converted to use a SCSI interface. The conversion cost is roughly $1500 U.S., and can be done by the Fermilab Equipment Support Department. This interface has the capability of driving serial and/or parallel branch highways. While parallel branch systems have a speed advantage as seen in the table above, there is a practical parallel branch highway length limit of about 38 meters. The practical length of a byte serial branch highway is dependent on interface clock speed, serial cable quality, the configuration of serial CAMAC controllers, bypass modules, and repeaters; but, working systems have had total lengths of about 300 meters. Depending on existing loan agreements with experiments at Fermilab, the Jorway 411S may be available from the Fermilab PREP Equipment Pool.

The Jorway 73A is a SCSI interface as well as a CAMAC crate controller. As a crate controller, it occupies slots 24 and 25 in a CAMAC crate. While it is a faster interface, the SCSI cable that connects it to the host computer should be no longer than 3 meters. The Jorway 73A is not generally available from the Fermilab PREP Equipment Pool, but can be ordered from Jorway Corporation for roughly $1800 U.S.

 

Additional Hardware Required

Jorway 411S - parallel

 

Jorway 411S - serial

 

Jorway 73A

 

SCSI Host Adapter Cards for PCs

Connecting a SCSI device like a Jorway to a PC requires an adapter to interface between the PC's internal ISA or PCI bus to SCSI. In most cases, this adapter will occupy one of the ISA or PCI internal slots in the PC, although some PC motherboards have built in SCSI controllers. PCs are supplied with this adapter if they were built with a CD ROM or hard disk using a SCSI interface. Most PCs however, do not have a built in SCSI controller or SCSI host adapter card, and one must be purchased separately.

An example to clarify the PC to CAMAC connection chain -

PC motherboard to PCI bus

PCI bus to SCSI Host adapter card

SCSI Host adapter card to SCSI cable

SCSI cable to Jorway 411S

Jorway 411S to serial or parallel branch cable

Branch cable to CAMAC Crate Controller

 

SCSI host adapter cards for this application cost about $140.00 U.S. A variety of venders can be searched using the Price Watch Web page. The Windows NT and Linux CAMAC libraries were both developed using the Adaptec AHA-2940 SCSI Host Adapter which is no longer available from Web sources. Beside what is mentioned below, others may work as well but have not been tested. Adapters are not supplied or supported at Fermilab.

Some miscellaneous notes on adapters:

 

Getting the software

All of the most recent versions of supported CAMAC driver/libraries are available from the Fermitools Web site. The Windows NT CAMAC library has an installation program with separate installation notes provided in a flat text README file. The Linux CAMAC

library is contained in a tar file. If you do not already have Linux installed on your PC, there is no official support from camac-support@fnal.gov for installing Linux, but good documentation is available from the Fermilab Linux Evaluation Project Web page.

 

Miscellaneous

Jorway 411S, Switching between serial and parallel crate controllers

The Jorway is capable of driving both serial and parallel branch highways, although most installations use one or the other exclusively. To switch existing software to run with a serial branch system instead of a parallel branch system requires only minor changes to the initialization code. Instead of calling the CAMAC library routine ccctype(branch, 0,1), setting the branch type to parallel, the call would be ccctype(branch,1,0) setting the branch type to serial. Also, serial crate controllers must be un-bypassed as the first step in their initialization with a call to the CAMAC library routine cccbyp(ext,0), with the second argument as 0 meaning "un-bypass" this crate controller. If code that contains a call to ccctype that sets the crate type to parallel is followed by a call to cccbyp, the cccbyp call is simply ignored. Initialization examples are provided in the /example directory provided with each CAMAC library.

 

Switching between Jorway 411S Jorway 73A

If you start system development with the Jorway 411S using the parallel port and then switch to the Jorway 73A, the only difference is that the crate number argument used in the CAMAC standard routine library calls has no meaning to the Jorway 73A. This does not require any code changes. For the purposes of setting the branch type with ccctype, the Jorway 73A is considered a parallel branch.

 

Which PROMs should be installed in my Jorway 73A?

The IRIX version of the sjy driver requires Rev. 2.8. The revision number is the suffix of the two 24 pin chips with tags "M73ALR2.8" and "M73AHR2.8". The WinNT and Linux version of the sjy driver will work with either Rev 2.7 or Rev 2.8, but Rev. 2.8 is recommended.

 

Trouble shooting a Linux-Jorway 73A installation

There are a couple things to check if your system hangs during boot:

o) SCSI bus termination problem. If your SCSI bus adapter card hosts other SCSI devices in your system such as a SCSI disk or SCSI CDROM, the addition of the Jorway 73A may cause a SCSI termination problem. The Jorway 73A as shipped from the factory has internal SCSI termination resistors that are powered by the CAMAC crate power supply. If the SCSI disk and/or another SCSI device are terminated as well, the SCSI bus may be over terminated. The Adaptec AHA-2940 installation information gives several examples of how to terminate multiple SCSI devices. You may need to refer to the documentation for your SCSI disk or other SCSI devices to determine if they are terminated. This information is often available from the SCSI device manufacturer Web pages.

o) Adaptec configuration. The AHA-2940UW has capabilities that need to be turned off or modified for the Jorway 73A. When your system boots, you can enter the Adaptec configuration utilities by typing a <Ctrl-A> just after you see the Adaptec BIOS message. Select the option Configure/View Host Adapter Settings. Under Additional Options, select SCSI device Configuration. For the SCSI id that corresponds to the one selected on the Jorway 73A front panel, set Initiate Wide Negotiation to off, and set Initiate Sync Negotiation to 20.0.

 

If the test programs do not work at all or give data mismatch error messages:

o) Make sure the front panel switch is in the On Line position.

o) Make sure there is a lemo jumper from Req to G in.

o) Make sure the Jorway 73A Endian jumper is in the correct position. More information on this is available in the sjyLX documentation.

o) Make sure that the permissions on your system’s SCSI generic device files (sga, sgb, sgc, sgd, sge, sgf, sgg, sgh) are set to crw-rw-rw-. By default, they are set to crw------- which prevents the sjyLX from opening the device files unless the user process has root privileges. To change the permissions on these files, login as root and execute the command chmod 666 /dev/sg*