MCA Data Server Reference

eMorpho

Introduction

USB driver

bpi_device

Data structures

Overview

Module Constants

FPGA Data structures

Controls

Statistics

Results

Histogram

List Mode

Oscilloscope Trace

Summation Weights

Time Slices

Two-bank List Mode

ARM Data structures

Version

Status

Controls

Calibration

API

Overview

The MCA-3K Programmer's Model

The MCA-3K has an embedded ARM M0+ MCU (Atmel SAM L21J), which includes a 32-bit ARM processor with a USB interface. Attached to the ARM M0+ is an FPGA that receives a continuous data stream from a waveform-digitizing ADC. The MCA function and all other data acquisition is implemented inside the FPGA. The ARM M0+ provides the USB interface and the system slow control, such as gain stabilization.

The software is structured into four layers as shown in the table below. It is written in Python and is compliant with Python 3.6 or higher.

Layer Purpose Description
mca_device.py USB driver This layer provides a Python interface to libusb0.1 using ctypes. Compiled libusb0.1 modules are provided for a number of platforms, and are also included by default in most commercial Linux computers. The most recent version also supports libusb1.0 directly via Python, without the need for explicit bindings via ctypes; cf https://libusb.info
mca3k_data.py Data descriptor This device-specific layer provides one class for each set of control and data registers within the MCA-3K. The classes have standardized functions to communicate with the API layer.
mca_api.py API Level This is the API layer used to process commands directed at a single MCA-3K or at an array of such devices.
mca_server.py Data server The data server is implemented using zero message queue ( zeromq.org). The server not only acts as a bridge between the detectors on the USB bus and the Internet, but also as a bridge between programming languages. All data are serialized using JSON strings. While the server is written in Python, clients can access the MCA-3K using any programming language they like. Further, complex tasks can be distributed over independent clients, eg DAQ, reach back and gain stabilization, rather than creating one very complex super client.