\chapter{Introduction}


\section{Historical Perspective}

Currently the Hartebeesthoek Radio Astronomy Observatory (HartRAO) runs 
its 26m antenna via a monolithic control system based on an HP1000 computer 
running the real time operating system RTE-6.  Configuration control is
achieved through a single custom built HP1000-specific Digital Input Output 
(DIO) unit.  The DIO consists of a set of unique wire wrapped input and 
output boards, each customised to match the interface it originally 
controlled but with a common programming interface.  Physically it is
constructed as a single contiguous unit with multiple layers of boards
connected by short lengths of ribbon cable.  All interfacing to equipment 
is done through a bank of custom connectors, hardwired into the backplane 
of the DIO itself.  Folklore has it that the DIO operates correctly only 
when extracted about 1 inch from the rack which houses it - a sure sign of 
instability and poor electrical connections.  Upgrades and extensions are 
exceedingly difficult because of the customised nature of each interface 
and the instability mentioned above.

In 1993, the original Serial Digital Input Output ({\em SDIO}) instrumentation 
bus was developed by Justin Jonas of Rhodes University as a low cost, easily 
extended distributed digital control interface for a portable radio telescope 
project.  The SDIO concept of remote microprocessor based digital input/output 
units controlled through a serial protocol proved to be highly successful. 
The same year NASA ported their Mark IV Field System (FS), used to control
the data acquisition equipment for Very Long Baseline Interferometry (VLBI)
experiments, to a personal computer architecture.  The original SDIO design 
was then borrowed by HartRAO to add a rudimentary control capability to this
new PCFS control system, seen as a prototype replacement for the HP1000.


\section{New Computer Control System}

In the move to a replacement New Computer Control System (NCCS), the SDIO
concept underwent several changes, prompted by design criteria based on the 
perceived failings of the current DIO.  The requirements were :
\begin{itemize}
\item Distributed Nature - all control functions need to be co-located with 
      the equipment they control ie.\ not in one central location.
\item Extendability - it should be possible to add capability at any
      point as required.
\item Reliability - all units should be interchangeable and upgradeable
      in-situ without wiring changes.
\item Fault Tolerance - there should be multiple independent circuits, each 
      tolerant to the failure of individual units.
\item Portability - control should be through a standard protocol likely 
      to be supported by future computer architectures, and capable of
      being carried by many different transmission media, in particular
      optic fibre.
\end{itemize}
The Mark II Serial Digital Input Output system detailed in this document
meets all the above criteria and should scale easily to meet all future
requirements.  Note however the present SDIO communication protocol does
not include any error correction.  Although operation with the PCFS has 
shown this is not a problem, this may become a further requirement as the 
communication links increase in length.


\section{SDIO Hardware}

The SDIO concept revolves around the use of microprocessors to provide
remote intelligence.  Each SDIO unit consists of a single Intel 80C51
microprocessor, acting through three 8-bit bi-directional buffers to
produce 24 bits of digital input/output.  Each SDIO unit has a unique
4-bit address (set by DIP switches), allowing up to 16 units to be
connected to any one circuit.  Communication is through a full-duplex
19.2 kBaud RS422 connection, ie.\ all 16 SDIO units listen simultaneously
on a common command bus and respond via a party-line response bus to 
those requests specifically addressed to them.  A simple RS232 $<-->$ 
RS422 converter connects this bus to a single standard RS232-based 
serial port.  The bus may also be extended over long distances using
a dedicated pair of optical fibres.  Each SDIO unit is then connected to 
external signal conditioning electronics to drive relays contacts, apply 
power to receiver electronics, sense physical conditions etc.


\section{SDIO Software}

Ths SDIO software is organised on a circuit by circuit basis.  All SDIO
units on any one circuit are controlled by a single device server process
which owns the corresponding serial port.  Each device is handled separately
in software with all inter-relations being hidden in the SDIO transport 
layer sub-objects.  The SDIO device server knows how to create and manage 
all type of SDIO devices, being suitably configured as required through the 
standard resource database mechanism.  See the configuration section of each 
device in turn for more details.


\section{Layout of this Document}

This document attempts to present the details of the design of the proposed
SDIO system, as adapted from the original by Jonathan Quick and Keith Jones
of HartRAO.  It is divided into two chapters dealing with the hardware and
software specifics.  Both chapters will need to be updated to reflect 
additional capability as it is added.  Everything is dealt with relatively 
verbosely in the interests of completeness.  Please refer to the individual 
userguides of the various SDIO-based devices for more concise usage notes.
