Index: /trunk/FACT++/gui/FactGui.h
===================================================================
--- /trunk/FACT++/gui/FactGui.h	(revision 11101)
+++ /trunk/FACT++/gui/FactGui.h	(revision 11102)
@@ -1331,4 +1331,7 @@
         fClockCondR14->setValue(sdata.fClockConditioner[6]);
         fClockCondR15->setValue(sdata.fClockConditioner[7]);
+
+        //fClockCondFreq->setEditText("");
+        fClockCondFreq->setCurrentIndex(0);
 
         fTriggerSeqPed->setValue(sdata.fTriggerSeqPed);
@@ -2182,4 +2185,12 @@
         fDimFadConnections   ("FAD_CONTROL/CONNECTIONS",     (void*)NULL, 0, this)
     {
+        fClockCondFreq->addItem("-/-", QVariant(-1));
+        fClockCondFreq->addItem("700 MHz", QVariant(700));
+        fClockCondFreq->addItem("1 GHz",   QVariant(1000));
+        fClockCondFreq->addItem("2 GHz",   QVariant(2000));
+        fClockCondFreq->addItem("3 GHz",   QVariant(3000));
+        fClockCondFreq->addItem("4 GHz",   QVariant(4000));
+        fClockCondFreq->addItem("5 GHz",   QVariant(5000));
+
         fTriggerWidget->setEnabled(false);
         fFtuWidget->setEnabled(false);
Index: /trunk/FACT++/gui/MainWindow.cc
===================================================================
--- /trunk/FACT++/gui/MainWindow.cc	(revision 11101)
+++ /trunk/FACT++/gui/MainWindow.cc	(revision 11102)
@@ -275,4 +275,10 @@
 }
 
+void MainWindow::on_fClockCondFreq_activated(int idx)
+{
+    if (!fInHandler)
+        Dim::SendCommand("FTM_CONTROL/SET_CLOCK_FREQUENCY", fClockCondFreq->itemData(idx).toInt());
+}
+
 void MainWindow::slot_fFtuLED_clicked()
 {
Index: /trunk/FACT++/gui/MainWindow.h
===================================================================
--- /trunk/FACT++/gui/MainWindow.h	(revision 11101)
+++ /trunk/FACT++/gui/MainWindow.h	(revision 11102)
@@ -66,5 +66,5 @@
     void on_fTimeMarkerDelay_valueChanged(int);
     void on_fDeadTime_valueChanged(int);
-
+/*
     void on_fClockCondR0_valueChanged(int) { }
     void on_fClockCondR1_valueChanged(int) { }
@@ -75,6 +75,8 @@
     void on_fClockCondR14_valueChanged(int) { }
     void on_fClockCondR15_valueChanged(int) { }
+*/
+    void on_fPrescalingVal_valueChanged(int);
 
-    void on_fPrescalingVal_valueChanged(int);
+    void on_fClockCondFreq_activated(int);
 
     // Tab: FTUs
Index: /trunk/FACT++/gui/design.ui
===================================================================
--- /trunk/FACT++/gui/design.ui	(revision 11101)
+++ /trunk/FACT++/gui/design.ui	(revision 11102)
@@ -52,5 +52,5 @@
       </property>
       <property name="currentIndex">
-       <number>3</number>
+       <number>0</number>
       </property>
       <property name="documentMode">
@@ -1341,5 +1341,5 @@
               </property>
               <layout class="QGridLayout" name="gridLayout_18">
-               <item row="3" column="1">
+               <item row="6" column="1">
                 <widget class="SpinBoxHex" name="fClockCondR0">
                  <property name="enabled">
@@ -1360,5 +1360,5 @@
                 </widget>
                </item>
-               <item row="3" column="2">
+               <item row="6" column="2">
                 <widget class="SpinBoxHex" name="fClockCondR1">
                  <property name="enabled">
@@ -1379,5 +1379,5 @@
                 </widget>
                </item>
-               <item row="3" column="3">
+               <item row="6" column="3">
                 <widget class="SpinBoxHex" name="fClockCondR8">
                  <property name="enabled">
@@ -1398,5 +1398,5 @@
                 </widget>
                </item>
-               <item row="3" column="4">
+               <item row="6" column="4">
                 <widget class="SpinBoxHex" name="fClockCondR9">
                  <property name="enabled">
@@ -1417,5 +1417,5 @@
                 </widget>
                </item>
-               <item row="4" column="1">
+               <item row="7" column="1">
                 <widget class="SpinBoxHex" name="fClockCondR11">
                  <property name="enabled">
@@ -1436,5 +1436,5 @@
                 </widget>
                </item>
-               <item row="4" column="2">
+               <item row="7" column="2">
                 <widget class="SpinBoxHex" name="fClockCondR13">
                  <property name="enabled">
@@ -1455,5 +1455,5 @@
                 </widget>
                </item>
-               <item row="4" column="3">
+               <item row="7" column="3">
                 <widget class="SpinBoxHex" name="fClockCondR14">
                  <property name="enabled">
@@ -1474,5 +1474,5 @@
                 </widget>
                </item>
-               <item row="4" column="4">
+               <item row="7" column="4">
                 <widget class="SpinBoxHex" name="fClockCondR15">
                  <property name="enabled">
@@ -1493,5 +1493,5 @@
                 </widget>
                </item>
-               <item row="2" column="2">
+               <item row="5" column="2">
                 <widget class="QLabel" name="label_11">
                  <property name="text">
@@ -1503,5 +1503,5 @@
                 </widget>
                </item>
-               <item row="2" column="1">
+               <item row="5" column="1">
                 <widget class="QLabel" name="label_16">
                  <property name="text">
@@ -1513,5 +1513,5 @@
                 </widget>
                </item>
-               <item row="2" column="3">
+               <item row="5" column="3">
                 <widget class="QLabel" name="label_17">
                  <property name="text">
@@ -1523,5 +1523,5 @@
                 </widget>
                </item>
-               <item row="2" column="4">
+               <item row="5" column="4">
                 <widget class="QLabel" name="label_18">
                  <property name="text">
@@ -1533,5 +1533,5 @@
                 </widget>
                </item>
-               <item row="5" column="1">
+               <item row="8" column="1">
                 <widget class="QLabel" name="label_19">
                  <property name="text">
@@ -1543,5 +1543,5 @@
                 </widget>
                </item>
-               <item row="5" column="2">
+               <item row="8" column="2">
                 <widget class="QLabel" name="label_20">
                  <property name="text">
@@ -1553,5 +1553,5 @@
                 </widget>
                </item>
-               <item row="5" column="3">
+               <item row="8" column="3">
                 <widget class="QLabel" name="label_21">
                  <property name="text">
@@ -1563,5 +1563,5 @@
                 </widget>
                </item>
-               <item row="5" column="4">
+               <item row="8" column="4">
                 <widget class="QLabel" name="label_22">
                  <property name="text">
@@ -1586,5 +1586,5 @@
                 </widget>
                </item>
-               <item row="6" column="2">
+               <item row="9" column="2">
                 <spacer name="verticalSpacer_12">
                  <property name="orientation">
@@ -1612,5 +1612,5 @@
                 </spacer>
                </item>
-               <item row="3" column="0">
+               <item row="6" column="0">
                 <spacer name="horizontalSpacer_25">
                  <property name="orientation">
@@ -1625,5 +1625,5 @@
                 </spacer>
                </item>
-               <item row="3" column="5">
+               <item row="6" column="5">
                 <spacer name="horizontalSpacer_26">
                  <property name="orientation">
@@ -1634,4 +1634,31 @@
                    <width>40</width>
                    <height>20</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+               <item row="3" column="2" colspan="2">
+                <widget class="QComboBox" name="fClockCondFreq">
+                 <property name="frame">
+                  <bool>true</bool>
+                 </property>
+                </widget>
+               </item>
+               <item row="2" column="2" colspan="3">
+                <widget class="QLabel" name="label_133">
+                 <property name="text">
+                  <string>DRS sampling frequency (def=2GHz)</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="4" column="2">
+                <spacer name="verticalSpacer_28">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>0</height>
                   </size>
                  </property>
Index: /trunk/FACT++/src/ftmctrl.cc
===================================================================
--- /trunk/FACT++/src/ftmctrl.cc	(revision 11101)
+++ /trunk/FACT++/src/ftmctrl.cc	(revision 11102)
@@ -898,4 +898,19 @@
     }
 
+    bool SetClockRegister(const uint64_t reg[])
+    {
+        for (int i=0; i<8; i++)
+        {
+            if (reg[i]>0xffffffff)
+                return false;
+
+            fStaticData.fClockConditioner[i] = reg[i];
+        }
+
+        CmdSendStatDat();
+
+        return true;
+    }
+
     bool EnablePixel(int16_t idx, bool enable)
     {
@@ -1390,4 +1405,61 @@
     }
 
+    int SetClockRegister(const EventImp &evt)
+    {
+        if (!CheckEventSize(evt.GetSize(), "SetClockRegister", 8*16))
+            return T::kSM_FatalError;
+
+        const uint64_t *reg = evt.Ptr<uint64_t>();
+
+        if (!fFTM.SetClockRegister(reg))
+            T::Warn("SetClockRegister - Value out of range.");
+
+        return T::GetCurrentState();
+    }
+
+    //map<uint32_t, uint32_t> fClockConditionerMap;
+
+    int SetClockFrequency(const EventImp &evt)
+    {
+        if (!CheckEventSize(evt.GetSize(), "SetClockFrequency", 4))
+            return T::kSM_FatalError;
+
+        const uint32_t freq = evt.GetUInt();
+
+        //map<uint32_t,uint32_t>::const_iterator = fClockConditionerMap.find(freq);
+
+        static const uint64_t R1  = 0x00010101;
+        static const uint64_t R8  = 0x10000908;
+        static const uint64_t R9  = 0xa0032a09;
+        static const uint64_t R11 = 0x0082000b;
+        static const uint64_t R13 = 0x020a000d;
+
+        static const uint64_t freq0700[8] = { 0x0003e000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400f50f };
+        static const uint64_t freq1000[8] = { 0x0003a000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
+        static const uint64_t freq2000[8] = { 0x00035000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
+        static const uint64_t freq3000[8] = { 0x00037200, R1, R8, R9, R11, R13, 0x0830400e, 0x1420a30f };
+        static const uint64_t freq4000[8] = { 0x00032800, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
+        static const uint64_t freq5000[8] = { 0x00032000, R1, R8, R9, R11, R13, 0x0830400e, 0x1400fa0f };
+
+        const uint64_t *reg = 0;
+
+        switch (freq)
+        {
+        case  700: reg = freq0700; break;
+        case 1000: reg = freq1000; break;
+        case 2000: reg = freq2000; break;
+        case 3000: reg = freq3000; break;
+        case 4000: reg = freq4000; break;
+        case 5000: reg = freq5000; break;
+        default:
+            T::Warn("SetClockFrequency - Frequency not supported.");
+            return T::GetCurrentState();
+        }
+
+        if (!fFTM.SetClockRegister(reg))
+            T::Warn("SetClockFrequency - Register values out of range.");
+
+        return T::GetCurrentState();
+    }
 
     int Enable(const EventImp &evt, FTM::StaticData::GeneralSettings type)
@@ -1694,4 +1766,14 @@
             (boost::bind(&StateMachineFTM::SetCalibWindow, this, _1))
             ("");
+
+        AddEvent("SET_CLOCK_FREQUENCY", "I:1", kStateIdle)
+            (boost::bind(&StateMachineFTM::SetClockFrequency, this, _1))
+            ("");
+
+        AddEvent("SET_CLOCK_REGISTER", "X:8", kStateIdle)
+            (boost::bind(&StateMachineFTM::SetClockRegister, this, _1))
+            ("");
+
+
 
         AddEvent("RESET_CRATE", "S:1", kStateIdle)
