\input{preamble.tex}
\graphicspath{{images/6302}, {images}}

\title{6302 Grabber}
\author{M-Labs Limited}
\date{April 2025}
\revision{Revision 1}
\companylogo{\includegraphics[height=0.73in]{artiq_sinara.pdf}}

\begin{document}
\maketitle

\section{Features}

    \begin{itemize}
        \item{CameraLink input interface for ARTIQ}
        \item{Support for several EMCCD cameras}
        \item{Low-latency image processing on-FPGA}
        \item{Stack retrieves data sum over rectangular ROIs}
    \end{itemize}

\section{Applications}

    \begin{itemize}
        \item{Ion fluorescence detection}
        \item{Cold atom fluorescence detection}
    \end{itemize}

\section{General Description}

The 6302 Grabber card is a 4hp EEM module, part of the ARTIQ/Sinara family. It adds frame grabber capabilities to carrier cards such as 1124 Kasli and 1125 Kasli-SoC. 6302 Grabber targets (EM)CCD scientific cameras using the CameraLink protocol standard. Using ARTIQ gateware, incoming camera signal is immediately transferred to the carrier card, where it can be processed with low latency on-FPGA .

The Sinara/ARTIQ stack supports defining rectangular ROIs (regions of interest); pixel value sums over these ROIs are reported to and can be used directly by ARTIQ kernels.

% Switch to next column
\vfill\break

%\begin{figure}[h]
%    \centering
%    \scalebox{1.15}{
%    \begin{circuitikz}[european, every label/.append style={align=center}]
%        \begin{scope}[]
%            % if applicable
%        \end{scope}
%    \end{circuitikz}
%    }

%    \caption{Simplified Block Diagram}
%\end{figure}

\begin{figure}[hbt!]
    \centering
    \includegraphics[height=3in, angle=-90]{photo6302.jpg}
    \caption{Grabber card}
    \includegraphics[height=3in, angle=90]{fp6302.jpg}
    \caption{Grabber front panel}
\end{figure}

% For wide tables, a single column layout is better. It can be switched
% page-by-page.
\onecolumn

\sourcesection{6302 Grabber}{https://github.com/sinara-hw/Grabber}

\section{Grabber I/O}

    6302 Grabber features two front-panel 26-pin MDR connectors, commonly used by CameraLink connections. Properly shielded and twisted cables intended for CameraLink should be used. For Base CameraLink, only one MDR connection (and one EEM) is necessary; higher-speed Medium CameraLink requires two.

    Power over CameraLink (PoCL) is not supported.

    \subsection{Grabber Single-/Double-/Triple-EEM Modes}

    6302 Grabber can operate with either a single, double, or triple EEM connection to a core device. The following table specifies the connections to use and the highest CameraLink configuration supported.

    \begin{table}[h]
        \centering
    \begin{threeparttable}
    \begin{tabularx}{0.4\textwidth}{|l|c|c| X}
        \hline
        \textbf{EEMs} & \textbf{Ports} & \textbf{CameraLink} \\
        \thickhline
        1 & \texttt{0} & Base CameraLink\\
        2 & \texttt{0, 1} & Medium CameraLink \\
        3 & \texttt{0, 1, 2} & Full CameraLink \\
        \thickhline
    \end{tabularx}
    \captionof{table}{Grabber EEM modes}
    \end{threeparttable}
    \end{table}

    Note that current ARTIQ gateware only supports Base Cameralink.

\sysdescsection

    6302 Grabber should be entered in the \texttt{peripherals} list of the corresponding core device in the following format:

    \begin{tcolorbox}[colback=white]
        \begin{minted}{json}
            {
                "type": "grabber",
                "ports": [0, 1]
            }
        \end{minted}
    \end{tcolorbox}

    Replace 0 and 1 with the EEM port numbers used on the core device. Any port numbers can be used. Specifying a second port is optional. If using Grabber in single-EEM mode, specify only \texttt{[0]}.

\newpage

\codesectionshort{6302 Grabber card}

    The following code specifies two ROIs (Regions of Interest), enables both, retrieves their accumulated data for a single frame, and disables the ROI engines.

    \inputcolorboxminted{firstline=9,lastline=31}{examples/grabber.py}

\ordersection{6302 Grabber}

\finalfootnote

\end{document}
