Nuclear Instruments and Methods in Physics Research B31 (1988) 487-490 North-Holland, Amsterdam
A FOUR INPUT ~L~~NNEL ON A 68000 ~ICROCO~~R
M~SSBAUER
SPE~TRO~E~R
487
BASED
E.C. PITZEN, J. JING and U. GONSER Angewandte Physik, Universitiit des Snarlandes, D-6600 Saarbriicken, FRC Received 21 December 1987
A four input multichannel analyzer for the acquisition of Miissbauer data was developed based on a 16 bit microcomputer. The hardware was realized as an interface board to the microcomputer and can operate under full program control. The software contains real-time graphic spectrum display and supports on-screen data evaluation. Compared to conventional mnltichannel analyzer systems, our system represents a flexible and high performs solution at very low cost.
1. Introduction
Since the discovery of the Mossbatter effect [l], Mijssbauer spectroscopy has become a very important tool in physics, chemistry, biology [2,3]. In the practial application of Mossbauer spectroscopy, the experimental setup normally consists of a drive system a gamma ray detector with a preamplifier and main amplifier/ single-channel analyzer and a multichannel analyzer system. The drive system provides the trigger signal to the multich~nel analyzer to start a spectrum sweep. Pulse signals supplied by the detector are amplified by the preamplifier and the main amplifier. The Mijssbauer emission line is then selected using the discriminator. The single-channel analyzer generates a standard pulse of defined length and height each time the incoming pulse falls into the selected energy range. Standard pulses encountered during the dwell time of a channel are bufferd in prescalers and then the data from each sweep are accumulated in the RAM of the microcomputer to improve the signal-to-noise ratio. Since the start of the sweep is synchronized through the signal provided by the drive system, each channel corresponds to a defined velocity of the drive. For spectrum analysis data are then transferred to a computer. The conventional multichannel systems are rather expensive and have limited applications, since they are not suited for data analysis. By contrast, a computer based spectrometer is more versatile. Earlier, minicomputers like PDP-11 were used [4]. However such systems involve even higher costs. Recently microcomputer based multichamrel systems for Miissbauer spectroscopy have been reported [5-Q However due to the low speed of earlier microprocessors, the data acquisition rate was limited. Also because of the lack of real-time spectrum display operation is rather laborious. 0168-583X/88/$03~50 @ Elsevier Science Publishers B.V. (North-Holland Physics Publishing Division)
New achievements in modem semiconductor technology have made the production of high speed microprocessors possible. This allows the design of a new microprocessor based multichannel analyzer capable of displaying graphically the data collection in real time because of the very high processing speed of these microprocessors. In this work we present the design of a four input multichannel Mossbauer spectrometer based on the 16 bit microcomputer with an 8 MHz 68000 microprocessor and the CP/M-68K operating system.
2. Hardware The Motorola M68000 microprocessor is a very powerful 16 bit microprocessor with internal 32 bit architecture [8]. It has a 16 bit data bus and a 24 bit address bus, and is capable of directly addressing 16 MBytes of memory. Seven priority coded interrupts are possible. Built-in 32 bit operations, including multiplication and division instruction, give the microprocessor a very high processing speed. In our design of the four input m~tichannel Mossbauer spectrometer we used the popular ~cr~omputer mc-68~0 available from Digital Service in Munich. The hardware is realized as an interface board which can be plugged into the slots of the mc-68000 microcomputer. Signals and timing are compatible with the standard VME bus system. TTL standard logic elements were used exclusively. For the prototype we used free-wiring on a commercial prototype-board. The basic design of our hardware is schematically shown in the block diagram of fig. 1. Compared to earlier designs as used for Apple II microcomputers, we used interrupt controlled data acquisiton rather than DMA (direct memory access). Since no complex hard-
E.C. Pitzen et al. / Microcomputer based Miissbauer spectrometer
488
*DV
x
HOLD
__p--L_
READ
J
CLEAR ~
-
I I
n 7
ADV
“TC
UI”
Counter
1 f MHz
_ 1 Reset
i, 16MHz
l-l-
ILL
I
I I
i lr Sweep Extern. Start ADV
Fig. 1. Schematic block diagram of the hardware. BIL: Bus Interface Logic. PC/R: Prescaler-Counter Register, DTG: Dwell Time Generator, TCL: TIME Control Logic, ADV: Advance (see text). The inset shows the timing of the control signals.
ware operation was needed, hardware cost is kept to a minimum. The hardware of the interface board consists mainly of four parts: a 16 bit programmable channel dwell time generator, a prescaler block for buffering the pulses from the detector/amplifier system during the prograd dweil time, a timing control iogic block and a bus interface logic block. The 16 bit dwell time generator is based on a 1 MHz signal which is derived from a quartz stabilized 16 MHz oscillator. Thus possible dwell times for each channel are thus from 1 to 65335 ps. However, due to the processing time of the interrupt service routines, the ~nimum dwell time is iimited to 30 ps in the four input model and to 20 ps for the single input model. The dwell time generator consists of a 16 bit register and a 16 bit down-counter. The programmed dwell times are stored in the registers and loaded into the down-counter. The counter is then decremented with the 1 MHz clock input. When the contents of the counter become zero, a channel advance signal is generated and the counter is immediately reloaded with the contents of the register. The counter will also be reloaded when the sweep start pulse of the drive system is given. In this way the start of the spectrum scan is always synchronized with the drive. In the timing control block the short signals from both the drive and the dwell time gnerator will be detected and stored in the internal interrupt register. Upon arrival of each channel advance signal the following sequence of command signals is generated: LOCK causes locking of the pre-caler inputs, READ transfers the contents of the pre-scaler to the registers, CLEAR resets the prescalers. At the same time an intrrupt request (IRQ) is sent to the processor. When the
processor is ready to accept the interrupt vector, an 8 bit vector is put on the bus. The timing relation between the signals can be seen in the diagram in the inset of fig. 1. At the end of this cycle, the internal interrupt register is cleared. To distinguish the two different sources of interrupts, namely the dweI1 time generator and the start signal coming from the drive, two different vectors will be generated. This guarantees immediate entry to the correct service routine. Incoming data pulses from four different detectors are stored in four g-bit prescalers. They are read out at the end of the channel dwell time. Since the microprocessor must first suspend the current program upon receiving an IRQ, it needs some microseconds to enter the interrupt service routine. Therefore the prescaler contents are first transferred to the registers. In this way the dead time during read operation is minimized to 500 ns, which is also the standard pulse length of our main amlifiers. Since pending input pulses can lead to ambient output of the prescaiers, data are held stabie during transfer by disabling the prescaler inputs using the LOCK-signal. All remaining operations for the completion of the spectrum are carried out by software. In the standard version of the program, 4-byte data are used to store the spectrum. This is the longest data form which can be processed by the microprocessor in one instruction.
3. Software The program flow-diagram is shown in fig. 2. Roughly the program can be divided into two parts. The main program has to display the spectrum and to
E. C. Pitzen et al. / Microcomputer
1
tl RTE
Interrupt I
Serwce and
Routines
II
Fig. 2. Flowchart diagram of the software. The box shows diagrams of the interrupt service routines (see text).
process various commands entered via the keyboard. However, the key parts of the software are two interrupt service routines (ISR) which are responsible for the data sampling. To enhance the processing speed and to allow real time spectrum display, all program parts are written in the assembly language. The program can be loaded and run under CP/M-68K like any other program. At the start of the program, the dwell time and the spectrum size are set. Virtually any spectrum size can be selected. The only limit for the size is the size of the memory. Then the two 1%‘~ will be installed. After initiation the main program is carried out. Once started, the main program runs in an endless loop, until a LEAVE command is given. Inter-communications between the main program and the interrupt service routines take place via special flag words and the common spectrum storage memory. When ISR I is called by the channel advance signal generated by the dwell time generator, prescalers are read. The contents of the prescaler are added to the spectrum. Then the current channel number is increased. If the channel number exceeds that of the preset spectrum size, a WAIT-flag will be set and further channel advance is prevented. The sweep start
based Miissbauer spectrometer
489
signal from the drive then calls the ISR II and the channel number is reset. Routine II also tests the STOP-flag. If a spectrum stop is requested, both interrupts are made inactive and the STOP-flag is set to a special code as the answer to the stop request. This flag can be tested again by the main program. In this way, a spectrum is always stopped at the end of a sweep. The main program contains several subroutines. They are responsible for the command processing. In the following a list of these subroutines is given along with a short comment on their functions. fetches the selected spectrum to be GETSPEC: displayed on the screen. Transforms the data to a proper form for the subroutine DISPSPEC. displays the spectrum by direct writDISPSPEC: ing into the refresh memory of the video display. obtains information from the keyGETKEY: board. If a command has been entered, it will be stored in a command register. displays additional information on DISPMARK: the screen, such as current spectrum, current marker position and counts etc. selects the spectrum currently to be SELSPEC: displayed. deletes the currently selected specDELSPEC: trum. selects the vertical range (counts) of SELRANGE: the display spectrum. automatically justifies the range AUTORANGE: selection so that no range overflow can occur on the screen. retains the current spectrum on the SAVESPEC: disk reads out the current spectrum SENDSPEC: through the serial RS232C port of the microcomputer. stops or starts the spectrum. CHKSTOP: leaves the program and restores the LEAVE: system. Command processing is organized in the following way each command corresponds to a subroutine. All subroutines are called sequentially. The subroutine itself determines whether it has to carry out the current command or not. If a subroutine is called and no corresponding command is found, it will be left soon. This type of organization makes future expansion of software functions very simple. On the other hand, it also provides a good overview of the entire program. For more details see [9]. For the real-time spectrum display the graphics information is written directly into the video refresh memory. Since the display has a resolution of 640 X 200
490
E.G. Pitzen et nl. / Microcomputer based Miissbuuer specrromeier
pixels, we used 512 x 128 for the spectrum display. The
remaining part of the display is used for additional information. For a better quality of the spectrum display only one of the four spectra is displayed on the screerr at a time. The spectrum to be displayed can be selected through the keyboard.
4. &Immary We constructed a four input multichanneX M&batter spectrometer based on the mc-68000 16 bit microcomputer, The interrupt technique was used to control data collection. To achieve maximum processing speed, the program was written exclusively in the assembly language. With a processor clock of 8 MHz as in the present case, data collection takes only 10% of the computing power when a dwell time of 200 ps is set. Since new processors with maximum clock frequency as high as Id MHz are available, the efficiency of our interface can be doubled. Compared to other designs, our solution has several advantages. Our hardware is compatible with the VME standard bus system. Therefore the use of the interface is not limited to one computer. By means of software, minimal hardware was possible by realizing most functions, which results in low costs. There is no limitation to the size of the spectrum since the microprocessor can address as many as 16 megabytes. A widely variable channel dwell time can fit different r~~rements. Real time spectrum display capability enhances the convenience of the operation. Future function expansions are possible by simply adding new subroutines. All these
factors give the spectrometer capabilities similar to those of professional systems like Nuclear Data or Tracer Northern. Beyond the Mossbatter data collection, the computer with its very powerful 68000 processor can also very effectively be used for data analysis. Since the software is written for them, CP~M-68K operating system, which is widely used in microcomputers with MC680~ microprocessor, our solution can easily be adapted to other microcomputers. The authors are indebted to Dr. F. Aubertin, Dr. W. -G. Wagner and Dipl. Phys. J. Bieg for helpful suggestions and discussions. We also thank Mrs. C. Schneider for the critical reading of the manuscript.
References [I) R.L. Massbauer, Z. Physik tSl(1958) 124. [2] U. Gonser, M&sbauer spectroscopy, Topics in Applied Physics, vol. S (Springer, Berlin, 1975). (31 N.N. Greenwood and T.C. Gibb, MBssbauer Spectroscopy (Chapman and Hall Ltd., 1971). [4] B. Window, B.C. Dickson, P. Routcliffe and K.K.P. Srivastava, J. Phys. E 7 (1978) 921. 151 B. Fultz and J.W. Moris Jr., Rev. Sci. Instr. 49 (1978) 1216. 161 T. Sandqvist and R. W%ppling, Nucl. Instr. and Meth. 205 (1983) 473. 171 T. Sandqvist, WWIP-1144 (1986). 19 W. Hilf and A. Nausch, M68000 Familie Part 1 & 2, (te-wi-Verlag, 1984). [9f EC. Pitzen, Diplomarbeit, Universitiit des Saarlandes (1988).