CAMAC and VME access function call

previous.gif Supported hardware - Top - Midas build options and operation considerations next.gif

Midas defines its own set of CAMAC, VME and FASTBUS calls in order to unify the different hardware modules that it supports. This interface method permits to be totally hardware as well as OS independent. The same user code developed on a system can be used as a template for another application on a different operating system.

While the file mcstd.h (Midas Camac Standard) provides the interface for the CAMAC access, the file mvmestd.h (Midas VME Standard) is for the VME access. An extra CAMAC interface built on the top of mcstd provides the ESONE standard CAMAC calls (esone.c).

Refers to the corresponding directories under /drivers to find out what module of each family is already supported by the current Midas distribution. /drivers/divers contains older drivers which has not yet been converted to the latest API.


Midas CAMAC standard functions

Please refer to mcstd.h for function description.


ESONE CAMAC standard functions

Not all the functionality of ESONE standard have been fully tested

Please refer to esone.c for function description.


Midas VME standard functions

This API provides basic VME access through a simple set of functions. Refer to mvmestd.h for more specific information. mvme_open() contains a general access code sample summarizing most of the mvme commands.


Computer Busy Logic

A "computer busy logic" has to be implemented for a front-end to work properly. The reason for this is that some ADC modules can be re-triggered. If they receive more than one gate pulse before being read out, they accumulate the input charge that leads to wrong results. Therefore only one gate pulse should be sent to the ADC's, additional pulses must be blocked before the event is read out by the front-end. This operation is usually performed by a latch module, which is set by the trigger signal and reset by the computer after it has read out the event:

The output of this latch is shaped (limited in its pulse with to match the ADC gate width) and distributed to the ADC's. This scheme has two problems. The computer generates the reset signal, usually by two CAMAC output functions to a CAMAC IO unit. Therefore the duration of the pulse is a couple of ms. There is a non-negligible probability that during the reset pulse there is another hardware trigger. If this happens and both inputs of the latch are active, its function is undefined. Usually it generates several output pulses that lead to wrong ADC values. The second problem lies in the fact that the latch can be just reset when a trigger input is active. This can happen since trigger signals usually have a width of a few tens of nanoseconds. In this case the latch output signal does not carry the timing of the trigger signal, but the timing of the reset signal. The wrong timing of the output can lead to false ADC and TDC signals. To overcome this problem, a more elaborate scheme is necessary. One possible solution is the use of a latch module with edge-sensitive input and veto input. At PSI, the module "D. TRIGGER / DT102" can be used. The veto input is also connected to the computer:

Latched trigger layout.
latch02.gif

To reset this latch, following bit sequence is applied to the computer output (signals are displayed active low):

Improved Latched trigger layout.
latch01.gif

The active veto signal during the reset pulse avoids that the latch can receive a "set" and a "reset" simultaneously. The edge sensitive input ensures that the latch can only trigger on a leading edge of a trigger signal, not on the removing of the veto signal. This ensures that the timing of the trigger is always carried at the ADC/TDC gate signal.

Veto Timing.
timing01.gif

previous.gif Supported hardware - Top - Midas build options and operation considerations next.gif


Midas DOC Version 1.9.5 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk