Index: firmware/FTM/FTM_central_control.vhd
===================================================================
--- firmware/FTM/FTM_central_control.vhd	(revision 11241)
+++ firmware/FTM/FTM_central_control.vhd	(revision 11485)
@@ -90,5 +90,10 @@
     crate_res_1 : out std_logic := '1';
     crate_res_2 : out std_logic := '1';
-    crate_res_3 : out std_logic := '1'
+    crate_res_3 : out std_logic := '1';
+    new_config_ftu     : in std_logic;  -- from ethernet_modul
+    new_config_ftu_ack : out std_logic := '0';  -- to ethernet_modul
+    config_single_FTU : out std_logic := '0';  -- to ftu_control
+    config_single_FTU_started : in std_logic;  -- from ftu_control
+    config_single_FTU_done : in std_logic  -- from ftu_control 
   );
 end FTM_central_control;
@@ -119,5 +124,6 @@
                                    CP_IDLE, CP_PING, CP_START_RATES, CP_READ_RATES, CP_READ_RATES_01,
                                    CP_SEND_START, CP_SEND_END,
-                                   CP_CRATE_RESET, CP_CRATE_RESET_01, CP_CRATE_RESET_ACK);
+                                   CP_CRATE_RESET, CP_CRATE_RESET_01, CP_CRATE_RESET_ACK,
+                                   CP_CFG_SINGLE_FTU, CP_CFG_SINGLE_FTU_01, CP_CFG_SINGLE_FTU_02, CP_CFG_SINGLE_FTU_ACK);
   signal state_central_proc : state_central_proc_type := CP_INIT;
 
@@ -306,4 +312,7 @@
             crate_reset_ack <= '1';
             state_central_proc <= CP_CRATE_RESET;
+          elsif (new_config_ftu = '1') then
+            new_config_ftu_ack <= '1';  -- just acknowledge and do nothing (complete config will follow anyway)
+            state_central_proc <= CP_CFG_SINGLE_FTU_ACK;
           end if;
 
@@ -352,4 +361,7 @@
             crate_reset_ack <= '1';
             state_central_proc <= CP_CRATE_RESET_ACK;
+          elsif (new_config_ftu = '1') then
+            new_config_ftu_ack <= '1';  -- acknowledge and then tell ftu_control to do it
+            state_central_proc <= CP_CFG_SINGLE_FTU;
           end if;
 
@@ -461,5 +473,33 @@
             state_central_proc <= CP_IDLE;
           end if;
-              
+
+        when CP_CFG_SINGLE_FTU =>
+          cc_state_test <= X"1E";
+          if (new_config_ftu = '0') then
+            new_config_ftu_ack <= '0';
+            config_single_FTU <= '1';
+            state_central_proc <= CP_CFG_SINGLE_FTU_01;
+          end if;               
+
+        when CP_CFG_SINGLE_FTU_01 =>
+          cc_state_test <= X"1F";
+          if (config_single_FTU_started = '1') then
+            config_single_FTU <= '0';
+            state_central_proc <= CP_CFG_SINGLE_FTU_02;
+          end if;
+          
+        when CP_CFG_SINGLE_FTU_02 =>
+          cc_state_test <= X"20";
+          if (config_single_FTU_done = '1') then
+            state_central_proc <= CP_RUNNING_01;
+          end if;
+
+        when CP_CFG_SINGLE_FTU_ACK =>
+          cc_state_test <= X"21";
+          if (new_config_ftu = '0') then
+            new_config_ftu_ack <= '0';
+            state_central_proc <= CP_IDLE;
+          end if;
+            
         when others =>
           cc_state_test <= X"1B";
Index: firmware/FTM/FTM_top.vhd
===================================================================
--- firmware/FTM/FTM_top.vhd	(revision 11241)
+++ firmware/FTM/FTM_top.vhd	(revision 11485)
@@ -418,4 +418,12 @@
   signal LP1_pulse_sig : std_logic := '0';
   signal LP2_pulse_sig : std_logic := '0';
+
+  signal new_config_ftu_sig       : std_logic;  -- initialized in ethernet_modul
+  signal new_config_ftu_ack_sig   : std_logic;  -- initialized in FTM_central_control
+  signal new_config_ftu_param_sig : std_logic_vector (15 DOWNTO 0);  -- initialized in ethernet_modul
+
+  signal config_single_FTU_sig : std_logic;  -- initialized in FTM_central_control
+  signal config_single_FTU_started_sig : std_logic;  -- initialized in FTM_ftu_control
+  signal config_single_FTU_done_sig : std_logic;  -- initialized in FTM_ftu_control
   
 --  component FTM_clk_gen
@@ -589,5 +597,10 @@
       crate_res_1 : out std_logic;
       crate_res_2 : out std_logic;
-      crate_res_3 : out std_logic
+      crate_res_3 : out std_logic;
+      new_config_ftu     : in std_logic;
+      new_config_ftu_ack : out std_logic := '0';
+      config_single_FTU : out std_logic := '0';
+      config_single_FTU_started : in std_logic;
+      config_single_FTU_done : in std_logic
     );
   end component;
@@ -609,4 +622,5 @@
       ping_all            : in std_logic;
       read_rates          : in std_logic;
+      config_single_FTU   : in std_logic;
       read_rates_started  : out std_logic := '0';
       read_rates_done     : out std_logic := '0';
@@ -615,8 +629,11 @@
       ping_all_started    : out std_logic := '0';
       ping_all_done       : out std_logic := '0';
+      config_single_FTU_started : out std_logic := '0';
+      config_single_FTU_done    : out std_logic := '0';
       ftu_active_cr0      :  in std_logic_vector (15 downto 0);
       ftu_active_cr1      :  in std_logic_vector (15 downto 0);
       ftu_active_cr2      :  in std_logic_vector (15 downto 0);
       ftu_active_cr3      :  in std_logic_vector (15 downto 0);
+      config_single_FTU_param : in std_logic_vector (15 DOWNTO 0);
       ftu_error_calls     : out std_logic_vector (15 DOWNTO 0) := (others => '0');
       ftu_error_data      : out std_logic_vector ((FTU_RS485_BLOCK_WIDTH - 1) downto 0) := (others => '0');
@@ -769,5 +786,8 @@
       current_cc_state       : IN     std_logic_vector (15 DOWNTO 0);
       start_run_param        : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0');
-      start_run_num_events   : OUT    std_logic_vector (31 DOWNTO 0) := (others => '0')
+      start_run_num_events   : OUT    std_logic_vector (31 DOWNTO 0) := (others => '0');
+      new_config_ftu         : OUT    std_logic                      := '0';
+      new_config_ftu_ack     : IN     std_logic;
+      new_config_ftu_param   : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0')
     );
   end component;
@@ -1032,5 +1052,10 @@
       crate_res_1 => crate_res1_sig,
       crate_res_2 => crate_res2_sig,
-      crate_res_3 => crate_res3_sig
+      crate_res_3 => crate_res3_sig,
+      new_config_ftu     => new_config_ftu_sig,
+      new_config_ftu_ack => new_config_ftu_ack_sig,
+      config_single_FTU => config_single_FTU_sig,
+      config_single_FTU_started => config_single_FTU_started_sig,
+      config_single_FTU_done => config_single_FTU_done_sig
     );
   
@@ -1051,4 +1076,5 @@
       ping_all            => ping_ftu_start_ftu_sig,
       read_rates          => rates_ftu_start_sig,
+      config_single_FTU   => config_single_FTU_sig,
       read_rates_started  => rates_ftu_started_sig,
       read_rates_done     => rates_ftu_ready_sig,
@@ -1057,8 +1083,11 @@
       ping_all_started    => ping_ftu_started1_sig,
       ping_all_done       => ping_ftu_ready1_sig,
+      config_single_FTU_started => config_single_FTU_started_sig,
+      config_single_FTU_done    => config_single_FTU_done_sig,
       ftu_active_cr0      => ftu_active_cr0_sig,
       ftu_active_cr1      => ftu_active_cr1_sig,
       ftu_active_cr2      => ftu_active_cr2_sig,
       ftu_active_cr3      => ftu_active_cr3_sig,
+      config_single_FTU_param => new_config_ftu_param_sig,
       ftu_error_calls     => ftu_error_calls_sig,
       ftu_error_data      => ftu_error_data_sig,
@@ -1209,5 +1238,8 @@
       current_cc_state       => current_cc_state_sig,
       start_run_param        => start_run_param_sig,
-      start_run_num_events   => start_run_num_events_sig
+      start_run_num_events   => start_run_num_events_sig,
+      new_config_ftu         => new_config_ftu_sig,
+      new_config_ftu_ack     => new_config_ftu_ack_sig,
+      new_config_ftu_param   => new_config_ftu_param_sig
     );
 
Index: firmware/FTM/ethernet/ethernet_modul_beha.vhd
===================================================================
--- firmware/FTM/ethernet/ethernet_modul_beha.vhd	(revision 11241)
+++ firmware/FTM/ethernet/ethernet_modul_beha.vhd	(revision 11485)
@@ -2,6 +2,6 @@
 --
 -- Created:
---          by - kai.users (tpkw.local.priv)
---          at - 11:20:56 04/20/11
+--          by - kai.UNKNOWN (E5PCXX)
+--          at - 13:50:41 30.06.2011
 --
 -- Generated by Mentor Graphics' HDL Designer(TM) 2009.1 (Build 12)
@@ -10,5 +10,4 @@
 USE ieee.std_logic_1164.all;
 USE ieee.std_logic_arith.all;
-
 library ftm_definitions;
 USE ftm_definitions.ftm_array_types.all;
@@ -118,5 +117,8 @@
       current_cc_state       : IN     std_logic_vector (15 DOWNTO 0);
       start_run_param        : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0');
-      start_run_num_events   : OUT    std_logic_vector (31 DOWNTO 0) := (others => '0')
+      start_run_num_events   : OUT    std_logic_vector (31 DOWNTO 0) := (others => '0');
+      new_config_ftu         : OUT    std_logic                      := '0';
+      new_config_ftu_ack     : IN     std_logic;
+      new_config_ftu_param   : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0')
    );
 
@@ -459,5 +461,8 @@
       crate_reset              : OUT    std_logic                      := '0';
       crate_reset_ack          : IN     std_logic ;
-      crate_reset_param        : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0')
+      crate_reset_param        : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0');
+      new_config_ftu           : OUT    std_logic                      := '0';
+      new_config_ftu_ack       : IN     std_logic ;
+      new_config_ftu_param     : OUT    std_logic_vector (15 DOWNTO 0) := (others => '0')
    );
    END COMPONENT;
@@ -717,5 +722,8 @@
          crate_reset              => crate_reset,
          crate_reset_ack          => crate_reset_ack,
-         crate_reset_param        => crate_reset_param
+         crate_reset_param        => crate_reset_param,
+         new_config_ftu           => new_config_ftu,
+         new_config_ftu_ack       => new_config_ftu_ack,
+         new_config_ftu_param     => new_config_ftu_param
       );
 
Index: firmware/FTM/ethernet/w5300_modul.vhd
===================================================================
--- firmware/FTM/ethernet/w5300_modul.vhd	(revision 11241)
+++ firmware/FTM/ethernet/w5300_modul.vhd	(revision 11485)
@@ -23,5 +23,4 @@
 USE IEEE.STD_LOGIC_ARITH.all;
 USE IEEE.STD_LOGIC_UNSIGNED.all;
-
 library ftm_definitions;
 USE ftm_definitions.ftm_array_types.all;
@@ -108,6 +107,11 @@
     crate_reset               : OUT std_logic := '0';
     crate_reset_ack           : IN  std_logic;
-    crate_reset_param         : OUT std_logic_vector (15 DOWNTO 0) := (others => '0')
+    crate_reset_param         : OUT std_logic_vector (15 DOWNTO 0) := (others => '0');
+    new_config_ftu            : OUT std_logic := '0';
+    new_config_ftu_ack        : IN  std_logic;
+    new_config_ftu_param      : OUT std_logic_vector (15 DOWNTO 0) := (others => '0')
+    
   );
+
 END w5300_modul ;
 
@@ -327,4 +331,9 @@
               ftu_error_send_ack <= '1';
               ftu_error_send_ready <= '1';
+              --
+              start_run <= '0';
+              stop_run <= '0';
+              crate_reset <= '0';
+              new_config_ftu <= '0';
               -- set internal signals
               new_config_flag <= '0';
@@ -769,4 +778,5 @@
                     crate_reset <= '1';
                     crate_reset_param <= cmd_array (2);
+--                    led_int <= cmd_array (2) (7 downto 0);
                     if (crate_reset_ack = '1') then
                       crate_reset <= '0';
@@ -776,4 +786,15 @@
                     end if;
 
+                  when CMD_CONFIG_FTU =>
+                    new_config_ftu <= '1';
+                    new_config_ftu_param <= cmd_array (2);
+--                    led_int <= cmd_array (2) (7 downto 0);
+                    if (new_config_ftu_ack = '1') then
+                      new_config_ftu <= '0';
+                      state_read_data <= RD_5;
+                    else
+                      state_init <= MAIN;
+                    end if;
+                    
                   when CMD_WRITE =>
                     case cmd_array (2) is
@@ -897,6 +918,6 @@
                   next_packet_data_cnt <= 0;
                   wait_for_data_flag <= '0';
+                  next_state_read_data <= RD_CMD;
                   new_config_flag <= '1';
-                  next_state_read_data <= RD_CMD;
                 end if;
 
Index: firmware/FTM/fad_broadcast/FTM_fad_broadcast.vhd
===================================================================
--- firmware/FTM/fad_broadcast/FTM_fad_broadcast.vhd	(revision 11241)
+++ firmware/FTM/fad_broadcast/FTM_fad_broadcast.vhd	(revision 11485)
@@ -121,5 +121,5 @@
   -- various loop counters
   signal frame_cnt : integer range 0 to (FAD_RS485_BLOCK_WIDTH / 8) := 0;
-  
+
   component FTM_fad_rs485_interface
     port(
Index: firmware/FTM/ftm_definitions.vhd
===================================================================
--- firmware/FTM/ftm_definitions.vhd	(revision 11241)
+++ firmware/FTM/ftm_definitions.vhd	(revision 11485)
@@ -167,16 +167,16 @@
 
   -- network settings Zuerich, for backup/test FTM
-  -- constant MAC_ADDRESS : mac_type := (X"FAC7", X"0FAD", X"1101");
-  -- constant NETMASK     : ip_type  := (255, 255, 248, 0);
-  -- constant IP_ADDRESS  : ip_type  := (192, 33, 99, 246);  --registered as ftmboard1.ethz.ch
-  -- constant GATEWAY     : ip_type  := (192, 33, 96, 1);
+  constant MAC_ADDRESS : mac_type := (X"FAC7", X"0FAD", X"1101");
+  constant NETMASK     : ip_type  := (255, 255, 248, 0);
+  constant IP_ADDRESS  : ip_type  := (192, 33, 99, 246);  --registered as ftmboard1.ethz.ch
+  constant GATEWAY     : ip_type  := (192, 33, 96, 1);
+  constant FIRST_PORT  : integer  := 5000;
+
+  -- network settings La Palma (internal subnet), for FTM in camera
+  -- constant MAC_ADDRESS : mac_type := (X"FAC7", X"1FAD", X"1102");
+  -- constant NETMASK     : ip_type  := (255, 255, 255, 0);
+  -- constant IP_ADDRESS  : ip_type  := (10, 0, 100, 140);
+  -- constant GATEWAY     : ip_type  := (10, 0, 100, 1);
   -- constant FIRST_PORT  : integer  := 5000;
-
-  -- network settings La Palma (internal subnet), for FTM in camera
-  constant MAC_ADDRESS : mac_type := (X"FAC7", X"1FAD", X"1102");
-  constant NETMASK     : ip_type  := (255, 255, 255, 0);
-  constant IP_ADDRESS  : ip_type  := (10, 0, 100, 140);
-  constant GATEWAY     : ip_type  := (10, 0, 100, 1);
-  constant FIRST_PORT  : integer  := 5000;
   
   -- W5300 settings
@@ -270,5 +270,5 @@
   constant FTM_STATE_CFG   : std_logic_vector := X"0002";
   constant FTM_STATE_RUN   : std_logic_vector := X"0003";
-  constant FTM_STATE_CALIB : std_logic_vector := X"0004";
+  --constant FTM_STATE_CALIB : std_logic_vector := X"0004";
   
   -- header length of data packages
@@ -363,8 +363,8 @@
       X"0000", -- SD_ADDR_lp2_delay         -- light pulser 2 delay
       X"0001", -- SD_ADDR_coin_n_p          -- majority coincidence n (for physics)
-      X"001E", -- SD_ADDR_coin_n_c          -- majority coincidence n (for calibration)
+      X"0014", -- SD_ADDR_coin_n_c          -- majority coincidence n (for calibration)
       X"0000", -- SD_ADDR_trigger_delay     -- trigger delay
       X"0000", -- SD_ADDR_timemarker_delay  -- timemarker delay
-      X"0017", -- SD_ADDR_dead_time         -- dead time, 8ns + 4x23ns = 100ns
+      X"00F8", -- SD_ADDR_dead_time         -- dead time, 8ns + 4x248ns = 1000ns
       X"0003", -- SD_ADDR_cc_R0_HI          -- clock conditioner R0 bits 31...16
       X"8000", -- SD_ADDR_cc_R0_LO          -- clock conditioner R0 bits 15...0
@@ -404,5 +404,5 @@
   --default values for active FTU lists
   constant sd_block_default_ftu_active_list : sd_block_default_ftu_active_list_type := (
-    X"0001",
+    X"0000",
     X"0000",
     X"0000",
Index: firmware/FTM/ftu_control/FTM_ftu_control.vhd
===================================================================
--- firmware/FTM/ftu_control/FTM_ftu_control.vhd	(revision 11241)
+++ firmware/FTM/ftu_control/FTM_ftu_control.vhd	(revision 11485)
@@ -56,17 +56,20 @@
     tx_d_3 : out STD_LOGIC;
 
-    -- commands from FTM main control
-    new_config : in std_logic;
-    ping_all   : in std_logic;
-    read_rates : in std_logic;
-
-    -- answers to FTM main control
-    read_rates_started : out std_logic := '0';
-    read_rates_done    : out std_logic := '0';
-    new_config_started : out std_logic := '0';
-    new_config_done    : out std_logic := '0';
-    ping_all_started   : out std_logic := '0';
-    ping_all_done      : out std_logic := '0';
-
+    -- commands from FTM central control
+    new_config        : in std_logic;
+    ping_all          : in std_logic;
+    read_rates        : in std_logic;
+    config_single_FTU : in std_logic;
+    
+    -- answers to FTM central control
+    read_rates_started        : out std_logic := '0';
+    read_rates_done           : out std_logic := '0';
+    new_config_started        : out std_logic := '0';
+    new_config_done           : out std_logic := '0';
+    ping_all_started          : out std_logic := '0';
+    ping_all_done             : out std_logic := '0';
+    config_single_FTU_started : out std_logic := '0';
+    config_single_FTU_done    : out std_logic := '0';
+    
     -- active FTU lists
     ftu_active_cr0 : in std_logic_vector (15 downto 0);
@@ -75,4 +78,7 @@
     ftu_active_cr3 : in std_logic_vector (15 downto 0);
 
+    -- parameter for config single FTU command
+    config_single_FTU_param : in std_logic_vector (15 DOWNTO 0);
+    
     --error message interface to ethernet control
     ftu_error_calls      : out std_logic_vector (15 DOWNTO 0) := (others => '0');
@@ -123,7 +129,9 @@
   
   -- FTU configuration data, read out from static RAM (board by board)
-  signal FTU_dac_array_RAM_sig    : FTU_dac_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'), (others => '0'));
-  signal FTU_enable_array_RAM_sig : FTU_enable_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'));
-  signal FTU_prescaling_RAM_sig   : std_logic_vector(15 downto 0) := (others => '0');
+  signal FTU_dac_array_RAM_sig      : FTU_dac_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'), (others => '0'));
+  signal FTU_dac_array_RAM_sig_2    : FTU_dac_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'), (others => '0'));
+  signal FTU_enable_array_RAM_sig   : FTU_enable_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'));
+  signal FTU_enable_array_RAM_sig_2 : FTU_enable_array_type := ((others => '0'), (others => '0'), (others => '0'), (others => '0'));
+  signal FTU_prescaling_RAM_sig     : std_logic_vector(15 downto 0) := (others => '0');
   
   -- signals for receiver of FTU communication
@@ -216,5 +224,7 @@
   signal FTU_cnt             : integer range 0 to NO_OF_FTUS_PER_CRATE := 0;
   signal FTU_register_cnt    : integer range 0 to (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG + 1) := 0;
+  signal FTU_register_cnt_2  : integer range 0 to (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG) := 0;
   signal FTU_command_cnt     : integer range 0 to 3 := 0;
+  signal FTU_command_cnt_2   : integer range 0 to 2 := 0;
   signal frame_cnt           : integer range 0 to (FTU_RS485_BLOCK_WIDTH / 8) := 0;
   signal FTU_list_reg_cnt    : integer range 0 to NO_OF_FTU_LIST_REG := 0;
@@ -229,4 +239,8 @@
   signal FTU_cnt_offset_sig   : integer range 0 to (NO_OF_DD_RAM_REG * NO_OF_FTUS_PER_CRATE) := 0;
   signal crate_cnt_offset_sig : integer range 0 to (NO_OF_CRATES * NO_OF_FTUS_PER_CRATE * NO_OF_DD_RAM_REG) := 0;
+
+  --Crate and Slot number for config_single_FTU command
+  signal single_FTU_crate_sig : integer range 0 to 7 := 0;
+  signal single_FTU_slot_sig  : integer range 0 to 15 := 0;
   
   component FTM_ftu_rs485_interface
@@ -306,5 +320,9 @@
                                            TRANSMIT_CONFIG_1, TRANSMIT_CONFIG_2, TRANSMIT_CONFIG_3,
                                            PING_1, PING_2, PING_3, PING_END_1, PING_END_2, PING_END_3,
-                                           FTU_LIST_1, FTU_LIST_2, FTU_LIST_3);
+                                           FTU_LIST_1, FTU_LIST_2, FTU_LIST_3,
+                                           GET_FTU_PAR, READ_CONFIG_SINGLE_FTU,
+                                           READ_CONFIG_SINGLE_FTU_1, READ_CONFIG_SINGLE_FTU_2, READ_CONFIG_SINGLE_FTU_3,
+                                           TRANSMIT_CONFIG_SINGLE_FTU_1, TRANSMIT_CONFIG_SINGLE_FTU_2, TRANSMIT_CONFIG_SINGLE_FTU_3,
+                                           TRANSMIT_CONFIG_SINGLE_FTU, CONFIG_SINGLE_FTU_END);
   signal FTM_ftu_rs485_control_State : FTM_ftu_rs485_control_StateType;
   signal after_error_State : FTM_ftu_rs485_control_StateType;
@@ -446,26 +464,37 @@
           --read_rates_done <= '0';
           if (new_config = '1') then
-            new_config_done <= '0';--
+            new_config_done <= '0';
             new_config_started <= '1';
             ping_all_started   <= '0';
             read_rates_started <= '0';
+            config_single_FTU_started <= '0';
             FTM_ftu_rs485_control_State <= ACTIVE_LIST;
           elsif (new_config = '0' and  ping_all = '1') then
-            ping_all_done   <= '0';--
+            ping_all_done   <= '0';
             new_config_started <= '0';
             ping_all_started   <= '1';
             read_rates_started <= '0';
+            config_single_FTU_started <= '0';
             rec_reset_sig <= '1';
             FTM_ftu_rs485_control_State <= PING;
           elsif (new_config = '0' and  ping_all = '0' and read_rates = '1') then
-            read_rates_done <= '0';--
+            read_rates_done <= '0';
             new_config_started <= '0';
             ping_all_started   <= '0';
             read_rates_started <= '1';
+            config_single_FTU_started <= '0';
             FTM_ftu_rs485_control_State <= RATES;
-          else
+          elsif (new_config = '0' and  ping_all = '0' and read_rates = '0' and config_single_FTU = '1') then
+            config_single_FTU_done <= '0';
             new_config_started <= '0';
             ping_all_started   <= '0';
             read_rates_started <= '0';
+            config_single_FTU_started <= '1';
+            FTM_ftu_rs485_control_State <= GET_FTU_PAR;
+          else
+            new_config_started <= '0';
+            ping_all_started   <= '0';
+            read_rates_started <= '0';
+            config_single_FTU_started <= '0';
             FTM_ftu_rs485_control_State <= IDLE;
           end if;
@@ -477,4 +506,9 @@
           active_FTU_array_sig(3) <= ftu_active_cr3;
           FTM_ftu_rs485_control_State <= READ_CONFIG;
+
+        when GET_FTU_PAR =>  -- copy FTU parameter (crate and slot) from input
+          single_FTU_crate_sig <= conv_integer(unsigned(config_single_FTU_param( 2 downto 0)));
+          single_FTU_slot_sig  <= conv_integer(unsigned(config_single_FTU_param(11 downto 8)));
+          FTM_ftu_rs485_control_State <= READ_CONFIG_SINGLE_FTU;
           
 --        when ACTIVE_LIST =>  -- loop over 4 crates to get active FTU list
@@ -536,4 +570,19 @@
           end if;
 
+        when READ_CONFIG_SINGLE_FTU =>  -- read configuration of one FTU
+          sel_crate_sig <= conv_std_logic_vector(single_FTU_crate_sig, 3);
+          if (FTU_register_cnt_2 < (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG)) then
+            FTU_register_cnt_2 <= FTU_register_cnt_2 + 1;
+            FTM_ftu_rs485_control_State <= READ_CONFIG_SINGLE_FTU_1;
+          else
+            FTU_register_cnt_2 <= 0;
+            if (active_FTU_array_sig(single_FTU_crate_sig)(single_FTU_slot_sig) = '1') then
+              rec_reset_sig <= '1';
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU;
+            else
+              FTM_ftu_rs485_control_State <= CONFIG_SINGLE_FTU_END;
+            end if;
+          end if;
+            
         when READ_CONFIG_1 =>
           if (static_RAM_busy = '0') then
@@ -545,10 +594,25 @@
             FTM_ftu_rs485_control_State <= READ_CONFIG_2;
           end if;
-            
+
+        when READ_CONFIG_SINGLE_FTU_1 =>
+          if (static_RAM_busy = '0') then
+            read_static_RAM <= '1';
+            addr_static_RAM <= conv_std_logic_vector(STATIC_RAM_CFG_FTU_OFFSET +
+                                                     single_FTU_crate_sig * NO_OF_FTUS_PER_CRATE * (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG + 1) +
+                                                     single_FTU_slot_sig * (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG + 1) +
+                                                     (FTU_register_cnt_2 - 1), STATIC_RAM_ADDR_WIDTH);
+            FTM_ftu_rs485_control_State <= READ_CONFIG_SINGLE_FTU_2;
+          end if;
+          
         when READ_CONFIG_2 =>
           if (static_RAM_started = '1') then
             FTM_ftu_rs485_control_State <= READ_CONFIG_3;
           end if;
-            
+
+        when READ_CONFIG_SINGLE_FTU_2 =>
+          if (static_RAM_started = '1') then
+            FTM_ftu_rs485_control_State <= READ_CONFIG_SINGLE_FTU_3;
+          end if;
+          
         when READ_CONFIG_3 =>
           if (static_RAM_ready = '1') then
@@ -562,4 +626,15 @@
             read_static_RAM <= '0';
             FTM_ftu_rs485_control_State <= READ_CONFIG;
+          end if;
+
+        when READ_CONFIG_SINGLE_FTU_3 =>
+          if (static_RAM_ready = '1') then
+            if ((FTU_register_cnt_2 - 1) < NO_OF_FTU_ENABLE_REG) then
+              FTU_enable_array_RAM_sig_2(FTU_register_cnt_2 - 1) <= data_static_RAM;
+            elsif ((FTU_register_cnt_2 - 1) < (NO_OF_FTU_ENABLE_REG + NO_OF_FTU_DAC_REG)) then
+              FTU_dac_array_RAM_sig_2((FTU_register_cnt_2 - 1) - NO_OF_FTU_ENABLE_REG) <= data_static_RAM;
+            end if;
+            read_static_RAM <= '0';
+            FTM_ftu_rs485_control_State <= READ_CONFIG_SINGLE_FTU;
           end if;
           
@@ -621,4 +696,47 @@
             FTM_ftu_rs485_control_State <= READ_CONFIG;
           end if;
+
+        when TRANSMIT_CONFIG_SINGLE_FTU =>  -- send configuration to one FTU
+          rec_reset_sig <= '0';
+          if (FTU_command_cnt_2 = 0) then  -- DACs
+            FTU_command_cnt_2 <= FTU_command_cnt_2 + 1;
+            enable_crc_from_FSM_sig <= '1';
+            crc_data_from_FSM_sig <= "00000000"
+                                     & "00000000" & "00000000" & "00000000" & "00000000" & "00000000"
+                                     & "00000000" & "00000000" & "00000000" & "00000000" & "00000000"
+                                     & "00000000"
+                                     & FTU_dac_array_RAM_sig_2(4)(15 downto 8) & FTU_dac_array_RAM_sig_2(4)(7 downto 0)
+                                     & FTU_dac_array_RAM_sig_2(3)(15 downto 8) & FTU_dac_array_RAM_sig_2(3)(7 downto 0)
+                                     & FTU_dac_array_RAM_sig_2(2)(15 downto 8) & FTU_dac_array_RAM_sig_2(2)(7 downto 0)
+                                     & FTU_dac_array_RAM_sig_2(1)(15 downto 8) & FTU_dac_array_RAM_sig_2(1)(7 downto 0)
+                                     & FTU_dac_array_RAM_sig_2(0)(15 downto 8) & FTU_dac_array_RAM_sig_2(0)(7 downto 0)
+                                     & "00000000" & FIRMWARE_ID & FTM_ADDRESS
+                                     & "00" & conv_std_logic_vector(single_FTU_slot_sig,4) & conv_std_logic_vector(single_FTU_crate_sig,2)
+                                     & FTU_RS485_START_DELIM;
+            FTU_brd_add_sig <= conv_std_logic_vector(single_FTU_slot_sig,4) & conv_std_logic_vector(single_FTU_crate_sig,2);
+            FTU_command_sig <= "00000000";
+            FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_1;
+          elsif (FTU_command_cnt_2 = 1) then  -- enables
+            FTU_command_cnt_2 <= FTU_command_cnt_2 + 1;
+            enable_crc_from_FSM_sig <= '1';
+            crc_data_from_FSM_sig <= "00000000"
+                                     & "00000000" & "00000000" & "00000000" & "00000000" & "00000000"
+                                     & "00000000" & "00000000" & "00000000" & "00000000" & "00000000"
+                                     & "00000000" & "00000000" & "00000000"
+                                     & FTU_enable_array_RAM_sig_2(3)(15 downto 8) & FTU_enable_array_RAM_sig_2(3)(7 downto 0)
+                                     & FTU_enable_array_RAM_sig_2(2)(15 downto 8) & FTU_enable_array_RAM_sig_2(2)(7 downto 0)
+                                     & FTU_enable_array_RAM_sig_2(1)(15 downto 8) & FTU_enable_array_RAM_sig_2(1)(7 downto 0)
+                                     & FTU_enable_array_RAM_sig_2(0)(15 downto 8) & FTU_enable_array_RAM_sig_2(0)(7 downto 0)
+                                     & "00000011" & FIRMWARE_ID & FTM_ADDRESS
+                                     & "00" & conv_std_logic_vector(single_FTU_slot_sig,4) & conv_std_logic_vector(single_FTU_crate_sig,2)
+                                     & FTU_RS485_START_DELIM;
+            FTU_brd_add_sig <= conv_std_logic_vector(single_FTU_slot_sig,4) & conv_std_logic_vector(single_FTU_crate_sig,2);
+            FTU_command_sig <= "00000011";
+            FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_1;
+          else
+            FTU_command_cnt_2 <= 0;
+            enable_crc_from_FSM_sig <= '0';
+            FTM_ftu_rs485_control_State <= CONFIG_SINGLE_FTU_END;
+          end if;
             
         when TRANSMIT_CONFIG_1 =>  -- wait one cycle for CRC calculation
@@ -626,5 +744,10 @@
           crc_data_from_FSM_sig_cp <= crc_data_from_FSM_sig;
           FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_2;
-          
+
+        when TRANSMIT_CONFIG_SINGLE_FTU_1 =>  -- wait one cycle for CRC calculation
+          enable_crc_from_FSM_sig <= '0';
+          crc_data_from_FSM_sig_cp <= crc_data_from_FSM_sig;
+          FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_2;
+            
         when TRANSMIT_CONFIG_2 =>  -- transmit byte by byte
           if (tx_busy_sig = '0') then
@@ -650,4 +773,28 @@
             FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_2;
           end if;
+
+        when TRANSMIT_CONFIG_SINGLE_FTU_2 =>  -- transmit byte by byte
+          if (tx_busy_sig = '0') then
+            if (frame_cnt < 27) then
+              frame_cnt <= frame_cnt + 1;
+              tx_data_sig <= crc_data_from_FSM_sig (7 downto 0);
+              crc_data_from_FSM_sig <= "00000000" & crc_data_from_FSM_sig ((FTU_RS485_BLOCK_WIDTH - 9) downto 8);
+              tx_start_sig <= '1';
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_2;
+            elsif (frame_cnt = 27) then
+              frame_cnt <= frame_cnt + 1;
+              ftu_error_data <= crc_sig & crc_data_from_FSM_sig_cp;
+              tx_data_sig <= crc_sig;
+              tx_start_sig <= '1';
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_2;
+            else
+              frame_cnt <= 0;
+              reset_crc_from_FSM_sig <= '1';
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_3;
+            end if;            
+          else
+            tx_start_sig <= '0';
+            FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_2;
+          end if;
           
         when TRANSMIT_CONFIG_3 =>  -- wait for FTU answer
@@ -687,4 +834,40 @@
           end if;
 
+          when TRANSMIT_CONFIG_SINGLE_FTU_3 =>  -- wait for FTU answer
+          reset_crc_from_FSM_sig <= '0';
+          if (FTU_answer_ok_sig = '1') then
+            timeout_cnt <= 0;
+            retry_cnt <= 0;
+            sel_crc_input_source_sig <= '0';
+            if (retry_cnt = 0) then  -- no errors 
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU;
+            else  -- send error message and move to next command;
+              ftu_error_calls <= conv_std_logic_vector((retry_cnt + 1), 16);
+              after_error_State <= TRANSMIT_CONFIG_SINGLE_FTU;
+              FTM_ftu_rs485_control_State <= SEND_ERROR_1;
+            end if;
+          else
+            if (timeout_cnt < FTU_RS485_TIMEOUT) then
+              timeout_cnt <= timeout_cnt + 1;
+              sel_crc_input_source_sig <= '1';
+              FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU_3;
+            else
+              timeout_cnt <= 0;
+              sel_crc_input_source_sig <= '0';
+              rec_reset_sig <= '1';
+              if (retry_cnt < FTU_RS485_NO_OF_RETRY) then
+                retry_cnt <= retry_cnt + 1;
+                FTU_command_cnt_2 <= FTU_command_cnt_2 - 1;  -- try this command again
+                FTM_ftu_rs485_control_State <= TRANSMIT_CONFIG_SINGLE_FTU;
+              else
+                retry_cnt <= 0;
+                FTU_command_cnt_2 <= FTU_command_cnt_2;  -- send error message and move to next command
+                ftu_error_calls <= (others => '0');
+                after_error_State <= TRANSMIT_CONFIG_SINGLE_FTU;
+                FTM_ftu_rs485_control_State <= SEND_ERROR_1;
+              end if;
+            end if;
+          end if;
+          
         when SEND_ERROR_1 =>  -- send an error message
           ftu_error_send <= '1';
@@ -698,4 +881,10 @@
             FTM_ftu_rs485_control_State <= after_error_state;
           end if;
+
+        when CONFIG_SINGLE_FTU_END =>
+          config_single_FTU_started <= '0';
+          config_single_FTU_done <= '1';
+          sel_crate_sig <= "111";
+          FTM_ftu_rs485_control_State <= IDLE;
           
         when PING =>  -- ping all FTUs
