\chapter{Front-End electronics}

\section{DCS board}
\index{DCS board}

\subsection{Reboot}
\index{DCS board!Reboot}

The DCS board has a reset flag which you can read back from memory after a
reboot in order to identify the reason for the reboot. To do this run the 
following command on the DCS board:
\begin{verbatim}
dcsboard:/ $ rdwrmem -s 0x7fffc004 -l 4 -b 4 -m
\end{verbatim}
which will produce an output like: \\
\begin{verbatim}
mmap 0x7fffc004 -> 0x40006004
7FFFC004:00000001
\end{verbatim}

The value of this bit is determined by what triggered the reboot. 
\begin{description}
\item[reboot-cmd:] 0x1
\item[Watchdog:] 0x1
\item[powercycle from neighbour:] 0x0
\item[reset from neighbour:] 0x0
\end{description}

\subsection{Reboot survival}

Due to the high radiation load on the DCS boards the boards occasionally reboot during data taking. This doesn't impose any problems to the data taking, but only to the operation of the corresponding chamber due to e.g.\ missing information on the boards. In order to still be able to operate the chambers after reboots of DCS boards the DCS board software was adapted. The full documentation of the changes can be found in App.\ E of. \cite{weiser19}



\section{Optical Readout Interface (ORI)}
\index{ORI}

\subsection{CPLD update from DCS board}
\index{ORI!CPLD update}

The CPLD of the ORI board can be updated from the DCS board using vmescsn. The
latest vme-file for programming can be retrieved from:\\
\verb+ http://alice.physi.uni-heidelberg.de/svn/trd/ORI_CPLD_design/trunk/lattice_ena_shdn/ori_erase_program_verify.vme+

The programming procedure for an equipped chamber is as follows:
\begin{itemize}
\item Copy the vme-file to /tmp/ on the DCS board.
\item Power the ROBs (e. g. via the FEE-server to STDBY\_INIT)
\item Kill the feeserver on the DCS board (if running).
\item execute on the DCS board: \\
\verb+ vmescsn -side <side> -ring 0 /tmp/<filename>.vme+
where <side> is either A or B
\item Wait (takes 5-10 min) 
\end{itemize}
You cannot update the ORI boards on both sides in parallel. 