Host Application

Overview

The host receives and decodes data from the PIC, turning a sequence of 17 packets into a 1024-element list---a full histogram. Each new list that comes in is added, element-wise, to a master histogram. The host does two things with the master histogram data. First, it saves the data to an ASCII file. Second, the host displays the data on a flux plot and on a histogram in real-time. A summary of the host's tasks is shown in Figure 1.

Software System-level Diagram
Figure 1: The diagram is a system-level description of the host application. Most tasks each consist of one class and multiple functions. The left side represents classes that interact with the PIC and USB. The right side includes classes that accept user input, display graphs, and save data.

Note that the host is running multiple threads corresponding to its various tasks. Because tasks such as receiving data and displaying the histogram happen asynchronously, threading is very appropriate.

Current Features

* Basic GUI with histogram and flux graphs

* Save data as ASCII

* Real-time update

* Expandable scale

* Start/stop acquisition

* Quit

Operation

When the user first runs the host application, they will be prompted to enter a few parameters. The GUI menu that takes parameter values is shown in Figure 2.

Menu: Input Parameters
Figure 2: The menu asks for the user for a few paramters, such as gain and threshold. The menu also asks the user to choose a coincidence mode of operation, and to specify the type(s) of data display.

The user may want to specify various threshold and gain values, depending on what kind of detector and X-ray source is used as the MCA front-end. Also, the menu allows the user to choose a desired coincidence mode. This menu information is relayed to the PIC before firmware data collection begins. After the program has been running for a while, the histogram graph may look something like Figure 3.

MCA Histogram Graph
Figure 3: The histogram graph is typical of what our device might read. The X-axis indicates the energy bin, or photon energy level. The Y-axis is in units of 'counts per energy bin'. The spectrum was captured from a decade-old Fe-55 source.

Notice that the histogram looks smooth and has a clearly defined shape, even though the histogram is made of 1024 discrete energy bins. This means that our MCA has enough voltage resolution---10 bits ---for sources like Iron-55. Even for X-ray sources with thinner energy spectra, our 10-bit MCA could still be sufficient if the user chose good values for threshold and gain.