Index: firmware/InterlockArduino/src/fact++interface/docu.tex
===================================================================
--- firmware/InterlockArduino/src/fact++interface/docu.tex	(revision 14236)
+++ firmware/InterlockArduino/src/fact++interface/docu.tex	(revision 14236)
@@ -0,0 +1,115 @@
+\title{FACT Arduino ethernet communication Interface }
+
+\section{Introduction}
+Arduino is the name of a series of open source 
+microcontroller equipped boards. The 
+microcontroller in use is out of Atmels ATmega family.
+
+The FACT telescope uses mostly the Arduino Ethernet board to 
+monitor and control certain auxiliary systems like the motors of the camera 
+shutter. 
+
+This board was chosen since the needed hardware for ethernet access, 
+like a dedicated ethernet controller (Wiznet W5100) and the jack, are already 
+in place. In addition the programming of the board, in comparably easy.
+
+Setting up a TCP/IP server (using a fix IP or a DHCP server) as well as 
+raw byte-stream communication with clients is handled by the Ethernet library,
+which comes with the Arduino IDE.
+
+There is a variety of open source extension boards available for the Arduino,
+both from the Arduino group as well as from unrelated developers. These
+extension boards are usually called shields.
+The shields can be connected to the ATmega port pins via 100mil headers,
+which can be used to connect custom peripherals as well.
+
+Typical ATmega digital outputs can drive up to 10mA at 5.0V and thus allow for 
+quick connection of LEDs for software tests or similar quick hacks.
+
+There exists an open source C cross compiler for Atmega as well a std-lib 
+implementation. The Arduino group created not only a user friendly 
+(maybe not power user friendly) IDE but also supplies the beginner with a 
+bunch of useful classes from serial communication to LCD interfacing. 
+
+\subsection{std C vs. Arduino quasi C++}
+The Arduino IDE provides the beginner with a simple programming enviroment.
+While the usual microcontroller program comprises of an init section
+and a never ending while loop which contains the actual job of the microcontroller,
+e.g. like this:
+\begin{verbatim}
+void main (void){
+
+    // set up peripherals and I/O pins
+    // e.g:
+    DDRD |= 1<<PD6;  // define pin PD6 to be an output
+    
+    // herein the actual 'job' is performed
+    while(1){
+        // toggle the output
+        PORTD ^= 1<<PD6;
+    }
+}
+
+This would look like this in Arduino quasi C++:
+\begin{verbatim}
+// On the Arduino board there are numbers printed 
+// next to the 100mil header sockets.
+// The ATmega pin PD6 is named '6' on the Arduino board.
+const int my_output_pin = 6;
+
+setup(){
+    pinMode( my_output_pin, OUTPUT);
+    boolean output_pin_state = false;
+}
+loop(){
+    // toggle the variable...
+    output_pin_state = !output_pin_state;
+    // write the value of the value, to the pin
+    digitalWrite( my_output_pin, output_pin_state);
+}
+\end{verbatim}
+
+In many cases, the code written in the Arduino-C++ dialect does not 
+produce the optimal binary, but one can always fall back to standard C
+and even use both styles of writing in one and the same source file.
+
+\subsection{ scheduling on microcontrollers }
+There is nothing like a schedular running on a microcontroller, so one can not
+produce concurrent running code by using threads. The developer needs 
+in such a case to implement a form of time sharing himself.
+
+Assume the following task:
+The ATmegas internal ADC should be used to measure a voltage as soon
+as an attached button is pressed. Since we expect some noise, the ADC should
+sample the voltage 100 times and return the mean and the std deviation.
+Since the user is expected to be slow, when pressing a button, 50 of the samples 
+shoule be taken, before the user pressed the button.
+We assume the CPU frequency is 16MHz. And the serial communication to run at
+9600 baud. 
+
+The ADC needs about 130us for a conversion. 
+
+
+(Although there might be libraries easing the pain a little out there.)
+The most prominent solution maybe looks like this
+\begin{verbatim}
+loop(){
+    check_if_a_button_was_pressed();
+    check_if_the_ADC_has_a_valid_reading();
+    calculate_something();
+    tell_the_world_about_it(); //9600 baud serial communication
+}
+In case each of the functions runs only a for little amount of time, 
+say about 10ms. the user experience is, that the reaction on a pressed button
+is immediate. Assume the ADC needs multiples of about 50ms to get a valid reading, 
+it is assured, that the ADC value is read out of the ADC reagister as soon as 
+it is valid, and the 
+
+\end{verbatim}
+
+
+\section{Usage}
+
+\section{Implementation}
+
+\section{Summary}
