  private:
   void update_clock()
   {
-    Timer1.detachInterrupt();
-    if(!seq_values.clock_ext)
-    {
-      Timer1.initialize(seq_values.clock_period * 1000);
+    if(seq_values.clock_ext)
+    {
+      Timer1.detachInterrupt();
+    }
+    else
+    {
+      Timer1.setPeriod(seq_values.clock_period * 1000);
       Timer1.attachInterrupt(clock_isr);
     }
   }


void clock_isr()
{
  clock_gate = function->gt_read(GT3);
  if(clock_gate)
  {
    step++;

    if(retrigger)
    {
      retrigger = false;
      clock_gate &= seq_values.clock_ext;
    }
  }

