This device support works with both the Struck STR7201 and the SIS3801 VME modules. The STR7201 is a module previously manufactured by Struck, and now by Bastian, which bought out Struck. The SIS modules are manufactured by SIS, which is a new company run by former Struck employees. Both are a VME modules with 32 (Struck 7201 and SIS3801) or 8 (SIS3808)) scaler input channels. In this document the term STR7201 includes all of the above modules, except where explicitly noted. Each input can count at 100MHz or 200MHz depending on model. It has an external channel advance input (called Next) which causes the the current scaler values to be copied to a FIFO, clears the scalers and resumes counting. The scalers are implemented in a dual-bank design, so that the switching time is less than 4 nsec.
The device support for the MCA record is written to support the use of the STR7201 as a multichannel scaler. Up to 32 records can be connected to each unit, each record corresponding to one of the signal inputs.
The STR7201 hardware itself is not a multichannel scaler in the conventional sense, since it simply contains a FIFO of scaler counts, rather than an array of memory locations which hold the counts for each dwell cycle. The device support for the STR7201 simulates a conventional MCS by allocating a memory buffer which contains the counts in each dwell period. The device support copies the counts from the FIFO to this memory buffer.
Each FIFO word contains the counts for one input signal for one dwell period. Available FIFO chips can hold from 2K to 32K words. The FIFO can thus buffer anywhere from 64 dwell cycles (32 active inputs, 2K FIFO) to 32,768 dwell cycles (1 active input, 32K FIFO). The minimum dwell time is in the range .5-4 microseconds, depending upon the number of active inputs. VME interrupts are implemented, so that FIFO readout is done automatically when the FIFO is half full. Even with interrupts there is a possibility of FIFO overflow with very short dwell times and small FIFO sizes. Users whose applications require short dwell times and a large number of active inputs should purchase large FIFO chips to prevent this. The FIFO chip can be replaced in the field. The device support determines the FIFO size automatically.
Jumper J600 on the board must be set to select LCA file 2 (STR7201 Design 1) or LCA file 3 (STR7201 Design 2). With Design 1 selected the scalers are 32 bits wide. With Design 2 selected the scalers are 24 bits wide, and the upper 8 bits of each data word contain information on the channel number, bank, and 2 user bits. The channel number and bank information are redundant since the device support sorts the FIFO output by channel number when copying the data to the buffer and then to the MCA record. However, some applications may want to use the 2 user bits which are latched with each Next cycle, and Design 2 may be selected for those applications.
The device support requires that the board be configured for VME A32 addressing, so jumper EN_A32 must be in place. Address selection is done with jumper J_A11, and switches SW_A32U, SW_A32L, SW_A24 and SW_A16. The software default address is 0xA0000000. Note that the factory-default address of 0x33508000 cannot be used with the APS version of the vxWorks board support package since this part of the VME A32 address space is not accessible. Each board takes up 2K bytes of A32 address space, so systems with multiple cards must configure card N at base address + 2K*N. For example, if using the default base address of 0xA0000000 the second card would be set to address 0xA00000800 (jumper J_A11 removed).
The device support software configures the control inputs in Mode 2, which means:
The device support for the STR7201 defines the INP field to be type VME_IO, and uses the normal "card" and "signal" conventions. A card is a single STR7201 module. Each module supports up to 32 signals (0-31), corresponding to the 32 inputs. Each MCA record is connected to one of these signal inputs.
The STRT, STOP and ERAS fields act on all records which are connected to a particular card. Thus it is only necessary to issue these commands to one record in order to start, stop or erase all other records.
Acqusition will be stopped for all records connected to a particular card whenever one or more of the following conditions is satisfied:
The CHAS field allows selecting internal or external channel advance.
The SEQ field is not implemented, since the device inherently has a fast time axis.
The DWEL field allows selecting the dwell time per channel when using internal channel advance.
The PSCL field allows selecting a pre-scale factor when using the external channel advance.
The MODE field is not implemented, since the STR7201 can only operate in MCS mode.
In addition to support for the MCA record, the driver supports the EPICS scaler record. Switching between scaler mode and MCA mode is handled automatically. It is important, however, that when acquiring in one mode that acquisition be allowed to complete before starting acquisition in the other mode. It is also important when acquiring in MCA mode to disable AutoCount in scaler mode, or else the MCA acquisition may be interrupted.
The mca/iocBoot/iocVxWorks contains example vxWorks startup scripts for the SIS3801/STR7201.
There are 2 functions which are intended to be called from the vxWorks startup script before iocInit.
STR7201Setup(int numCards, int baseAddress, int interruptVector, int interruptLevel)
numCards
is the maximum number of STR7201 cards in the VME crate.
The default value is 4 and the memory usage for unused cards is very small.baseAddress
is the base address of the first STR7201. The default
is 0xA0000000. The card must be configured to reside in the A32 VME address space.interruptVector
is the interrupt vector of the first STR7201. The
default is 220 (decimal). interruptLevel
is the VME interrupt level. The default is 6.numCards
, baseAddress
, interruptVector
,
and interruptLevel
are all acceptable then STR7201Setup
does not have to be called from the vxWorks startup script. STR7201Config(int card, int maxSignals, int maxChans, int ch1RefEnable,
int softAdvance)
card
is the number of the card being configured, in the range 0 to
numCards-1
.maxSignals
is the number of input signals which will be used, in
the range 1 to 32. maxSignals
controls how many scaler values will
be copied to the FIFO each time a Next signal is received. Set this value to the
actual number of signals actually being used to conserve FIFO memory on the card
and vxWorks buffer memory in the driver. The number of MCA records which can be
attached to this card is also controlled by maxSignals
.maxChans
is the maximum number of channels (time points) which which
will be used in any MCA record connected to this card. The number of bytes of vxWorks
buffer memory allocated by the driver for this card is maxChans * maxSignals
* 4
, so set this value to the actual maximum number of channels to be
used in any record to conserve memory.ch1RefEnable
is used to enable (1) or disable (0) the internal reference
clock on channel 1.softAdvance
is used to enable a software channel advance when acquisition
is started. If enabled then pulses are counted immediately into the first bin when
acquisition is started. If disabled it requires a channel advance signal before
counting begins.