Index: firmware/FSC/src/FSC_eth_with_user_interface.c
===================================================================
--- firmware/FSC/src/FSC_eth_with_user_interface.c	(revision 10674)
+++ firmware/FSC/src/FSC_eth_with_user_interface.c	(revision 10674)
@@ -0,0 +1,309 @@
+//-----------------------------------------------------------------------------
+#include "typedefs.h"
+#include "application.h"
+#include "spi_master.h"
+#include "ad7719_adc.h"
+#include "atmega_adc.h"    
+#include "usart.h"
+#include "macros.h"
+#include "muxer_fsc.h"
+#include "output.h"
+#include "parser.h"
+#include "interpol.h"
+#include "w5100_spi_interface.h"
+#include "timer.h"
+#include <avr/interrupt.h>
+#include <avr/wdt.h>
+#include <stdlib.h>
+
+// MAIN WORKFLOW GLOBAL VARIABLES
+	bool verbose;  // should go to w5100.c or so
+	bool heartbeat_enable;
+	
+// AD7719 global variables
+	U32 ad7719_values[RESISTANCE_CHANNELS];
+	U08 ad7719_enables[RESISTANCE_CHANNELS/8];
+	U08 ad7719_channels_ready[RESISTANCE_CHANNELS/8];
+	U08 ad7719_readings_since_last_muxing = 0;
+	U08 ad7719_current_channel = 0;
+	U32 ad7719_current_reading = 0;
+	bool ad7719_measured_all = false;
+	bool ad7719_values_printed = true;
+	bool ad7719_print_endless = false;
+
+// ATMEGA ADC global variables
+	U08 adc_values[VOLTAGE_CHANNELS]; // stores measured voltage in steps of 16mV
+	U08 adc_enables[VOLTAGE_CHANNELS/8];
+	U08 adc_channels_ready[VOLTAGE_CHANNELS/8];
+	U08 adc_readings_since_last_muxing = 0;
+	U08 adc_current_channel = 0;
+	U08 adc_current_reading = 0;
+	bool adc_measured_all = false;
+	bool adc_values_printed = true;
+	bool adc_print_endless = false;
+
+	bool once_told_you = true;
+	bool debug_mode = false;
+
+//-----------------------------------------------------------------------------
+//   M A I N    ---   M A I N    ---   M A I N    ---   M A I N    ---  M A I N    
+//-----------------------------------------------------------------------------
+int main(void)
+{
+	
+
+	U16 received_bytes;
+	U08 really_downloaded_bytes;
+	while(!usart_rx_ready){
+		received_bytes = get_S0_RX_RSR();
+		
+		usart_write_U16_hex(get_S0_TX_FSR()); usart_write_char('\t'); usart_write_char('|');
+		usart_write_U16_hex(get_S0_TX_RD()); usart_write_char('\t'); usart_write_char('|');
+		usart_write_U16_hex(get_S0_TX_WR()); usart_write_char('\t'); usart_write_char('|');
+		usart_write_U16_hex(get_S0_RX_RSR()); usart_write_char('\t'); usart_write_char('|');
+		usart_write_U16_hex(get_S0_RX_RD()); usart_write_char('\t'); usart_write_char('|');
+		
+	
+		if (get_S0_RX_RSR() != 0) { // we have something to read
+			usart_write_str((pU08)"\nReading ");
+			usart_write_U16(get_S0_RX_RSR(), 6);
+			usart_write_str((pU08)" b from W5100\n");
+		
+			while (received_bytes != 0) {
+				really_downloaded_bytes = w5100_get_RX(16, true);
+				usart_write_char('!');
+				usart_write_U08(really_downloaded_bytes,4);
+				usart_write_char('\n');
+				for (U08 i=0; i<really_downloaded_bytes; i++){
+					usart_write_U08_hex(eth_read_buffer[i]);
+					usart_write_char(' ');
+				}
+				received_bytes -= really_downloaded_bytes;
+			}
+		}
+		usart_write_char('\n');
+		
+		_delay_ms(400);
+		_delay_ms(400);
+		_delay_ms(400);
+		_delay_ms(400);
+	}
+	usart_rx_ready = false;
+	
+	bool quit = false;
+	while (!quit) {
+	usart_write_str((pU08)"Enter the string to send to PC or \"XXX\" in order to quit\n");
+		while(!usart_rx_ready){
+			_delay_ms(100);
+		}
+		usart_rx_ready = false;
+	
+		if ( (usart_rx_buffer[0]=='X') &&  (usart_rx_buffer[1]=='X') && (usart_rx_buffer[2]=='X') )
+			quit = true;
+		else {
+			// copy string to W5100 TX buffer and issue 'SEND' command.
+			for (U08 i =0; i<usart_received_chars; i++){
+				eth_write_buffer[i]=usart_rx_buffer[i];
+			}
+			
+			w5100_set_TX(usart_received_chars);
+			
+		}		
+			
+		
+	}
+	
+} // end of main()	
+
+int main(void)
+{
+	app_init();		  // Setup: Watchdog and I/Os
+	usart_init();
+	spi_init(); 		// Initialize SPI interface as master
+	timer_init();		// set up TIMER2: TIMER2_COMP interrupt occurs every 1ms
+	
+	w5100_reset();
+	w5100_init();
+
+	//  Enable interrupts
+	sei();
+
+	
+for ( U08 i=0; i < (RESISTANCE_CHANNELS/8); ++i ) {
+	ad7719_enables[i]=0x00;
+	ad7719_channels_ready[i]=0;
+	}
+for ( U08 i=0; i < (VOLTAGE_CHANNELS/8); ++i ) {
+	adc_enables[i]=0x00;
+	adc_channels_ready[i]=0;
+}
+
+	static U08 welcome[]="welcome to:\n FSC command interface 0.1 \n build: ??.05.2010\n";
+	usart_write_str(welcome);
+	print_help();
+	print_adc_enable_status(true);
+	usart_write_char('\n');
+	print_ad7719_enable_status(true);
+	usart_write_char('\n');
+	usart_write_str((pU08)"time:");
+	usart_write_U32(sec , 7);
+	usart_write_str((pU08)" sec.\n");
+
+//MAIN LOOP
+while (1)
+{
+	if (w5100_caretaker())
+	{
+	// something is not okay with the ethernet ... 
+	// will be reset in the next revolution.. but maybe we want to do more...
+	}
+	
+	if ( (milisec % W5100_INPUT_CHECK_TIME == 0) && (w5100_ready) )
+	{
+		if (get_S0_RX_RSR() != 0) { // we have something to read
+			really_downloaded_bytes = w5100_get_RX(ETH_READ_BUFFER_SIZE, true);
+		}
+	}
+	
+//----------------------------------------------------------------------------
+	if (check_if_adc_measurement_done()) {
+		if(adc_print_endless){
+			usart_write_str((pU08)"V|");
+			usart_write_float((float)local_ms/1000 , 1,4);
+			print_adc_nicely(false,true);
+			for ( U08 i=0; i<V_BITMAP; ++i ) {
+				adc_channels_ready[i]=0;
+			}
+		} else 
+		if ( !adc_values_printed) {
+			adc_values_printed = true;
+			print_adc_nicely(true,true);
+		}
+	} 
+
+	if (check_if_ad7719_measurement_done()) {
+		if(ad7719_print_endless){
+			usart_write_str((pU08)"R|");
+			usart_write_float((float)local_ms/1000 , 1,4);
+			print_ad7719_nicely(false,true);
+			for ( U08 i=0; i<CHANNEL_BITMAP; ++i ) {
+				ad7719_channels_ready[i]=0;
+			}
+		} else 
+		if ( !ad7719_values_printed) {
+			ad7719_values_printed = true;
+			print_ad7719_nicely(true,true);
+		}
+	} 
+
+//----------------------------------------------------------------------------
+
+	// in order to check the user interface on a hardware near level.
+	// user can issue 'heartbeat command'.
+	// then this üpin is toggled with the 'main-while-loop-frequency'
+	// --> nice check for this frequency as well
+	if (heartbeat_enable) {
+		PORTA ^= (1<<HEARTBEATPIN);
+	}
+		
+//----------------------------------------------------------------------------
+	//IF we need to send away one byte, and ready to send
+	// apparently depricated
+	if ( (usart_tx_buffer_index > 0) && (UCSRA & (1<<UDRE)) ) { 
+		UDR = usart_tx_buffer[0];
+		// THis is shit
+		for (U08 i=0 ; i < USART_TX_BUFFER_SIZE; ++i) {
+			usart_tx_buffer[i] = usart_tx_buffer[i+1];
+		}
+		usart_tx_buffer_index--;
+	}
+
+//----------------------------------------------------------------------------
+
+	//IF USART DOR bit is set, PC is sending data to fast!!!
+	if ( UCSRA & (1<<DOR) ){
+		usart_write_str((pU08)"PC sending to fast!\n");
+		usart_last_char = UDR;
+		// flush TX_buffer and write warning message in
+		// maybe even switch off every measurement. ?
+	}
+//----------------------------------------------------------------------------
+
+	//IF TX_BUFFER was overrun.	
+	if (usart_tx_buffer_overflow) {
+		// flash TX_buffer and write warning message in
+		// maybe even switch off every measurement. ?
+		//
+		// this should only happen, in verbose mode and with low baudrates.
+	}
+//----------------------------------------------------------------------------
+	
+	//IF one command was received. 
+	//	-It is not allowed to send more than one command between two '\n'
+	if (usart_rx_ready){ 
+		void MSR_parser();
+	}
+//----------------------------------------------------------------------------
+
+	//IF ATmega internal ADC did finish a conversion --every 200us
+	if ( (ADCSRA & (1<<ADIF)) && !adc_measured_all) {
+		adc_current_reading = (U16)ADCL;
+		adc_current_reading += (U16)ADCH<<8;
+		if (adc_readings_since_last_muxing == ADC_READINGS_UNTIL_SETTLED+adc_readings_until_mean-1) {
+			adc_channels_ready[adc_current_channel/8] |= (1<<(adc_current_channel%8));
+			adc_current_channel = increase_adc (adc_current_channel);
+			adc_values[adc_current_channel] = 0;
+			Set_V_Muxer(adc_current_channel);
+			adc_readings_since_last_muxing = 0;
+			_delay_ms(10);
+		}
+		else if (adc_readings_since_last_muxing >= ADC_READINGS_UNTIL_SETTLED-1) {
+			adc_values[adc_current_channel] += adc_current_reading;
+			++adc_readings_since_last_muxing;
+		}
+		else  {
+			++adc_readings_since_last_muxing;
+		}
+
+	}
+//----------------------------------------------------------------------------
+
+	//IF AD7719 ADC just finished a conversion -- every 60ms
+	
+	if (AD7719_IS_READY() && !ad7719_measured_all) {
+		ad7719_current_reading = read_adc(); // --takes at 4MHz SCLK speed about 6us
+		// AD7719 is only read out if settled. saves time.	
+		if (ad7719_readings_since_last_muxing == AD7719_READINGS_UNTIL_SETTLED-1) {
+			ad7719_values[ad7719_current_channel] = ad7719_current_reading;
+			ad7719_readings_since_last_muxing=0;
+			if (debug_mode) {
+				usart_write_U32_hex(ad7719_current_reading);
+				usart_write_char('\n');
+				usart_write_char('\n');
+			}
+			// now prepare the data to be send away via USART.
+			
+			// note that this channel is ready, now and 
+			// proceed to the next enabled channel.
+			ad7719_channels_ready[ad7719_current_channel/8] |= (1<<(ad7719_current_channel%8));
+			ad7719_current_channel = increase_ad7719 (ad7719_current_channel);
+			Set_T_Muxer(ad7719_current_channel);
+		} else { // the AD7719 did not settle yet, we discard the reading
+			++ad7719_readings_since_last_muxing;
+			if (debug_mode) {
+				usart_write_U32_hex(ad7719_current_reading);
+				usart_write_char('\n'); 
+			}
+
+			// current reading is not used for anything else
+		}
+	}
+
+
+} // end of MAIN LOOP
+
+} // end of main function
+//-----------------------------------------------------------------------------
+//    E N D     E N D     E N D     E N D     E N D     E N D     E N D     
+//-----------------------------------------------------------------------------
+
Index: firmware/FSC/src/application.h
===================================================================
--- firmware/FSC/src/application.h	(revision 10668)
+++ firmware/FSC/src/application.h	(revision 10674)
@@ -8,4 +8,10 @@
 
 //-----------------------------------------------------------------------------
+
+// in order to check the user interface on a hardware near level.
+// user can issue 'heartbeat command'.
+// then this üpin is toggled with the 'main-while-loop-frequency'
+// --> nice check for this frequency as well
+#define HEARTBEATPIN PB3
 
 // SPI DEFINITIONS
@@ -27,16 +33,12 @@
 #ifndef ___MAIN_WORKFLOW_GLOBAL_VARS
 #define ___MAIN_WORKFLOW_GLOBAL_VARS
-	#define TEMP_CHANNELS 64
-	#define CHANNEL_BITMAP 8
+	#define RESISTANCE_CHANNELS 64
 	#define AD7719_READINGS_UNTIL_SETTLED 3 // bei3:480ms
 	
-	#define V_CHANNELS 40
-	#define I_CHANNELS 40
-	#define H_CHANNELS 4
-	#define V_BITMAP 5
-	#define I_BITMAP 5
-	#define H_BITMAP 1
+	#define VOLTAGE_CHANNELS 84
 	#define ADC_READINGS_UNTIL_SETTLED 1
 #endif
+
+#define W5100_INPUT_CHECK_TIME 25 // defines how often the W5100 should be asked if something arrived... in ms
 
 // MAIN WORKFLOW GLOBAL VARIABLES
@@ -50,19 +52,24 @@
 
 // AD7719 global variables
-	extern U32 ad7719_values[TEMP_CHANNELS];
-	extern U08 ad7719_enables[CHANNEL_BITMAP];
-	extern U08 ad7719_channels_ready[CHANNEL_BITMAP];
+	extern U32 ad7719_values[];
+	extern U08 ad7719_enables[];
+	extern U08 ad7719_channels_ready[];
 	extern U08 ad7719_readings_since_last_muxing;
 	extern U08 ad7719_current_channel;
 	extern U32 ad7719_current_reading;
 	extern bool ad7719_measured_all;
+	extern bool ad7719_values_printed;
+	extern bool ad7719_print_endless;
+
 // ATMEGA ADC global variables
-	extern U08 adc_values[V_CHANNELS + I_CHANNELS + H_CHANNELS]; // stores measured voltage in steps of 16mV
-	extern U08 adc_enables[V_BITMAP + I_BITMAP + H_BITMAP];
-	extern U08 adc_channels_ready[V_BITMAP + I_BITMAP + H_BITMAP];
+	extern U08 adc_values[]; // stores measured voltage in steps of 16mV
+	extern U08 adc_enables[];
+	extern U08 adc_channels_ready[];
 	extern U08 adc_readings_since_last_muxing;
 	extern U08 adc_current_channel;
 	extern U08 adc_current_reading;
 	extern bool adc_measured_all;
+	extern bool adc_values_printed;
+	extern bool adc_print_endless;
 
 	extern bool once_told_you;
Index: firmware/FSC/src/output.c
===================================================================
--- firmware/FSC/src/output.c	(revision 10668)
+++ firmware/FSC/src/output.c	(revision 10674)
@@ -2,4 +2,5 @@
 #include "usart.h"
 #include "application.h"
+#include "timer.h"
 
 void print_status() {
@@ -29,5 +30,5 @@
 
 	usart_write_str((pU08)"time:");
-	usart_write_float((float)local_ms/1000 , 1,7);
+	usart_write_U32(sec,10);
 	usart_write_str((pU08)" sec.\n");
 
Index: firmware/FSC/src/parser.c
===================================================================
--- firmware/FSC/src/parser.c	(revision 10668)
+++ firmware/FSC/src/parser.c	(revision 10674)
@@ -105,2 +105,202 @@
 	
 }
+
+
+// this is the recent MSR parser
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+/////////////// P A R S E R /////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+// this method parses the data, 
+// which came in via USART
+// later it might as well parse the data from ethernet.
+void MSR_parser() {
+
+U08 input_number = 0;
+bool enable = false;
+// look at first byte
+// I hope, I can manage to use one byte commands
+	usart_rx_buffer[USART_RX_BUFFER_SIZE-1] = 0;
+	usart_write_char(' ');
+	usart_write_str(usart_rx_buffer);
+	usart_write_char('\n');
+	//usart_write_str((pU08)"\n received number of bytes:");
+	//usart_write_U08(usart_rx_buffer_index,3);
+
+	if (usart_rx_buffer_index >0) {
+		switch (usart_rx_buffer[0]) {
+			case 'E': 		// user wants to enable/disable something
+			case 'e':
+				enable = true;
+			case 'D':
+			case 'd':
+			
+				if (usart_rx_buffer_index>=1) {  // let's see what.
+					if ( 	usart_rx_buffer[1] != 'r'  &&
+							usart_rx_buffer[1] != 'v'  &&
+							usart_rx_buffer[1] != 'h'  &&
+							usart_rx_buffer[1] != 'p' )
+						{
+							print_invalid_enable_statement();
+							break;
+						}
+				}
+				
+				input_number = 0;
+				if (usart_rx_buffer_index >2) {  // lets check the first digit
+					if ( usart_rx_buffer[2] >= '0' && usart_rx_buffer[2] <= '9' ) {
+						input_number = usart_rx_buffer[2] - '0';
+					} else {
+						print_invalid_enable_statement();
+						break;
+					}
+				}
+				if (usart_rx_buffer_index >3) {  // lets check the 2nd digit
+					if ( usart_rx_buffer[3] >= '0' && usart_rx_buffer[3] <= '9' ) {
+						input_number = 10*input_number + usart_rx_buffer[3] - '0';
+					} else {
+						// okay as well ... if the second digit is missing .. 
+						// we might have trailing spaces
+						// that's okay .. we just accept the first number.
+					}
+				}
+				if (usart_rx_buffer_index>2) {
+					usart_write_str((pU08)"\n I will switch ");
+					if (enable) 
+						usart_write_str((pU08)"on ");
+					else
+						usart_write_str((pU08)"off ");
+					
+					// now we know, what the user wanted ... and we need to do it.
+					switch (usart_rx_buffer[1]) {
+						case 'r':
+							if (enable)
+								ad7719_enables[input_number/8] |= (1<<(input_number%8));
+							else {
+								ad7719_enables[input_number/8] &= ~(1<<(input_number%8));
+								ad7719_channels_ready[input_number/8] &= ~(1<<(input_number%8));
+								}
+							usart_write_str((pU08)" resistance channel ");
+							usart_write_U08(input_number,2);
+							usart_write_char('\n');
+							break;
+						case 'v':
+							if (enable)
+								adc_enables[input_number/8] |= (1<<(input_number%8));
+							else {
+								adc_enables[input_number/8] &= ~(1<<(input_number%8));
+								adc_channels_ready[input_number/8] &= ~(1<<(input_number%8));
+								}
+							usart_write_str((pU08)" voltage channel ");
+							usart_write_U08(input_number,2);
+							usart_write_char('\n');
+							break;
+							
+						case 'h':
+							if (enable)
+								adc_enables[1] |= (1<<(input_number%4));
+							else {
+								adc_enables[1] &= ~(1<<(input_number%4));
+								adc_channels_ready[1] &= ~(1<<(input_number%4));
+								}
+							usart_write_str((pU08)" humidity channel ");
+							usart_write_U08(input_number,2);
+							usart_write_char('\n');
+							break;
+						case 'p':
+							if (enable)
+								adc_enables[1] |= (1<<((input_number%4) + 4));
+							else {
+								adc_enables[1] &= ~(1<<((input_number%4) + 4));
+								adc_channels_ready[1] &= ~(1<<((input_number%4) + 4));
+								}
+							usart_write_str((pU08)" pressure channel ");
+							usart_write_U08(input_number,2);
+							usart_write_char('\n');
+							break;
+						default:
+							usart_write_str((pU08)"\n DAMN! this should never happen"
+							"- enable/disable switch-case!\n");
+							break;
+					}
+					
+					
+					
+				}// end of if usart_rx_buffer_index>2  --> this should not be necessary at all
+				break;
+				
+			case 'b':
+				usart_write_str((pU08)"\nheartbeat ");
+				heartbeat_enable = true;
+				if (usart_rx_buffer[1] == '0'){
+					heartbeat_enable = false;
+					usart_write_str((pU08)"off\n");
+				} else {
+					usart_write_str((pU08)"on\n");
+				}
+				break;
+			case 'G': 			// GET the Temperature channels, which are enabled
+				ad7719_values_printed = false;
+				for ( U08 i=0; i<CHANNEL_BITMAP; ++i ) {
+					ad7719_channels_ready[i]=0;
+				}
+				break;
+			case 'g':			// GET the voltage/current/humidity channels, which are enabled
+				adc_values_printed = false;
+				for ( U08 i=0; i<V_BITMAP; ++i ) {
+					adc_channels_ready[i]=0;
+				}
+				break;
+
+			case 'p':
+					adc_print_endless = true;
+				if (usart_rx_buffer[1] == '0')
+					adc_print_endless = false;
+				break;		
+
+			case 'P':
+					ad7719_print_endless = true;
+				if (usart_rx_buffer[1] == '0')
+					ad7719_print_endless = false;
+				break;		
+				
+
+			case 's':			
+				print_adc_enable_status(true);
+				usart_write_char('\n');
+
+				print_ad7719_enable_status(true);
+				usart_write_char('\n');
+			
+				usart_write_str((pU08)"time:");
+				usart_write_float((float)local_ms/1000 , 1,7);
+				usart_write_str((pU08)" sec.\n");
+				break;	
+
+			case '!':
+				usart_write_str((pU08)"\ndebug mode ");
+				debug_mode = true;
+				if (usart_rx_buffer[1] == '0'){
+					debug_mode = false;
+					usart_write_str((pU08)"off\n");
+				} else {
+					usart_write_str((pU08)"on\n");
+				}
+				break;		
+				
+			case 'h':
+			case 'H':
+				print_help();
+				break;
+		}
+	} else
+	{
+		// zero bytes received
+	}
+	
+	
+	for (U08 i=0; i<USART_RX_BUFFER_SIZE; ++i)
+		usart_rx_buffer[i] = 0;
+	usart_rx_buffer_index = 0;	
+	usart_rx_ready = false;
+}	// END of MSR_parser();
+
Index: firmware/FSC/src/parser.h
===================================================================
--- firmware/FSC/src/parser.h	(revision 10668)
+++ firmware/FSC/src/parser.h	(revision 10674)
@@ -3,5 +3,5 @@
 
 void parse_ascii(); 
-
+void MSR_parser() ;
 
 // all allowed non readable commands are listed here
Index: firmware/FSC/src/timer.c
===================================================================
--- firmware/FSC/src/timer.c	(revision 10674)
+++ firmware/FSC/src/timer.c	(revision 10674)
@@ -0,0 +1,28 @@
+#include "typedefs.h"
+#include <avr/interrupt.h>
+
+
+	volatile U16 milisec = 0;
+	volatile U32 sec = 0;
+
+void timer_init() {
+	// TIMER2 is used as local clock:
+	// configure timer 2
+	TCCR2 = (1<<WGM21); // CTC Modus
+	TCCR2 |= (1<<CS21) | (1<<CS20); // Prescaler 64 --> counts up every 8us
+	OCR2 = 125-1; 					// --> output compare interrupt occurs every 125 x 8us = 1ms
+	// Compare Interrupt erlauben
+	TIMSK |= (1<<OCIE2);
+	
+}
+
+ISR (TIMER2_COMP_vect)
+{
+	if (milisec < 999)
+ 		++milisec;
+	else {
+		milisec = 0;
+		sec++;
+	}
+		
+}
Index: firmware/FSC/src/timer.h
===================================================================
--- firmware/FSC/src/timer.h	(revision 10674)
+++ firmware/FSC/src/timer.h	(revision 10674)
@@ -0,0 +1,10 @@
+#ifndef __TIMER_H
+#define __TIMER_H
+
+	extern volatile U16 milisec;
+	extern volatile U32 sec;
+	
+void timer_init();
+ISR (TIMER2_COMP_vect);
+
+#endif //__TIMER_H
Index: firmware/FSC/src/usart.c
===================================================================
--- firmware/FSC/src/usart.c	(revision 10668)
+++ firmware/FSC/src/usart.c	(revision 10674)
@@ -8,4 +8,10 @@
 
 #endif
+
+	U08 usart_tx_buffer[USART_TX_BUFFER_SIZE];
+	U08 usart_tx_buffer_index = 0;
+	bool usart_tx_buffer_overflow = false;	// true if usart_tx_buffer was full.
+
+
 
 #ifdef USART_USE_RX_IRQ
Index: firmware/FSC/src/w5100_spi_interface.c
===================================================================
--- firmware/FSC/src/w5100_spi_interface.c	(revision 10668)
+++ firmware/FSC/src/w5100_spi_interface.c	(revision 10674)
@@ -9,4 +9,50 @@
 
 //-----------------------------------------------------------------------------
+// INTERFACE CONTROL VARS
+
+bool w5100_needs_reset = true;
+bool w5100_needs_init = true;
+bool w5100_ready = false;
+
+U08 w5100_caretaker() {
+U08 socket_status;
+	if (w5100_needs_reset)
+		w5100_reset();
+		
+	socket_status = w5100_sock_status();
+	
+	if (socket_status == SR_SOCK_ESTABLISHED) {
+		w5100_ready = true;
+		// everything is fine... 
+		return 0;
+	}
+	else if(socket_status < SR_SOCK_ESTABLISHED) {
+	// it might be LISTENING ... or not even OPEN
+		if (socket_status == SR_SOCK_CLOSED) {
+			w5100_init();
+		}
+		if (socket_status == SR_SOCK_INIT) {
+			w5100_init();
+		}
+		if (socket_status == SR_SOCK_LISTEN) {
+			
+		}
+	}	
+	else { // all other socket states need a reset
+		w5100_needs_reset = true;
+	}
+w5100_ready = false;
+return 1;
+}
+
+void w5100_reset() {
+	PORTB &= ~(1<<PB2); //#reset = LOW --> W5100 is in reset ... 
+	_delay_ms(50); //reset
+	
+	PORTB |= 1<<PB2; //#reset = HIGH --> W5100 is active
+	_delay_ms(5);		// give it 5ms to accomodate.
+	w5100_needs_reset = false;
+}
+
 
 void w5100_write( U16 addr, U08 data)
Index: firmware/FSC/src/w5100_spi_interface.h
===================================================================
--- firmware/FSC/src/w5100_spi_interface.h	(revision 10668)
+++ firmware/FSC/src/w5100_spi_interface.h	(revision 10674)
@@ -10,5 +10,5 @@
 
 
-#define ETH_READ_BUFFER_SIZE 16
+#define ETH_READ_BUFFER_SIZE 32
 #define ETH_WRITE_BUFFER_SIZE 16
 extern volatile U08 eth_read_buffer[ETH_READ_BUFFER_SIZE];
@@ -216,2 +216,13 @@
 void w5100_TX(U08 NumBytes, U08 *str);
 U08 w5100_set_TX(U08 NumBytes);
+
+extern bool w5100_needs_reset;
+extern bool w5100_needs_init;
+extern bool w5100_ready;
+
+
+
+U08 w5100_caretaker();
+void w5100_reset() ;
+
+
