MCA Software V3 – Common USART interface

Common USART Interface

Introduction

Embedded-C Driver

Product-specific Implementation

Reference (pdf)

Common Serial Interface – Hardware Implementation

The serial interface is implemented on the same I/O pins as the ARM SWD (Software Debug Interface). If it is necessary to preserve the ability to reprogram the ARM processor, then the serial Tx/Rx pins must be connected directly to the host. Since the low-power ARM processor can only drive 1mA, these lines can be sensitive to electromagnetic interference. Even the powerful trigger-out pulse that is available on some devices can cause interference if the wrong type of cabling is used.

Connecting a wire or cable directly to the ARM processor outputs is mostly used when the counter or MCA PCB is embedded into a shielded enclosure with the host processor or host computer being nearby.

External cable runs, outside a shielded enclosure, should not be used when connecting directly to the ARM processor I/O pins.

Note that the USB port of the ARM processor is much more EMI resistant than the serial interface.

SiPM-Counter

Examples for the SiPM-Counter are located in wxMCA/examples/counter/Raspberry_Pi3_serial/ .

Implementation

For the SiPM-counter we show an implementation, without using the logger, that uses the same 256 byte (64-item) data buffer for read and writes to arm_version, arm_ctrl and arm_status. The resulting software can execute in a small embedded processor requiring less than 384 bytes of RAM.

If the host microprocessor has 1KB of RAM the SiPM-Counter can also be operated via the examples shown in wxMCA/examples/mca1k/Raspberry_Pi3_serial/

The logger is a built-in function of the SiPM-Counter and the MCA-1K that provides a rolling list of 1024 samples of two variables; eg operating voltage and count rate, or net counts and alarm probability. To make full use of the logger capability, the host processor needs an additional 8kB of RAM.

SiPM-1000 and PMT-1000 (MCA-1K)

Examples for the MCA-1K are located in wxMCA/examples/mca1k/Raspberry_Pi3_serial/ .

Implementation

Here we show an implementation, without using the logger, that uses distinct data arrays for arm_version, arm_status, arM-ctrl, arm_cal and the 2080-item histogram buffer that contains the foreground/sample and the background/no-sample spectrum. The total RAM requirement for the data arrays is 9152 bytes.

By default, the serial baud rate is set to 115200, which translates to about 11.5kB/s. Hence, transferring a single spectrum of 16+1024 entries takes 0.36s. While the transfer is taking place, the MCA can not acquire data.

The maximum possible baud rate is 3MBd, which would reduce the histogram transfer time to 14ms.

SiPM-3000 and PMT-3000 (MCA-3K)

Examples for the MCA-3K are located in wxMCA/examples/mca3k/Raspberry_Pi3_serial/ .

Implementation

Here we show an implementation, that uses distinct data arrays for all ARM and FPGA data endpoints.

In practice, it would be unusual to communicate with the powerful MCA-3K devices via a serial link. However, sometimes serial communication via RS485 can be a convenient and simple method to bridge long distances.

In the MCA-3K devices, the FPGA continues to acquire data even while the ARM processor is busy transferring data. When using two-bank mode, this enables loss-less data acquisition, independent of transfer times and compuer latencies.