     maxm2.write(0);
     maxm2.stop();
 
-    //TODO check the RTC is working correctly
-
-    // Start tasks after a pause for the power supply to settle
-    // Not sure where the "pause" came from!
-    scheduler.timer(OPER_TIME, startup_pause);
+    // Check the RTC is working correctly
+    DateTime t1 = RTC.now();
+    // Wait 2 seconds and see if the clock changes
+    Sleepy::loseSomeTime(2000);
+    DateTime t2 = RTC.now();
+
+    // If no time elapsed, RTC is stopped so blink both LEDs 8 times
+    if (t1.second() == t2.second()) {
+        doFlash(ledPort, 1 + 2, 8);
+    }
+
+    // Start the main task
+    scheduler.timer(OPER_TIME, 0);
 }
 
 void loop () {

const byte maxm2Dev = 13;

// Start and end hours of operation
const unsigned char start_hh = 18;
const unsigned char start_mm = 39;
const unsigned char stop_hh = 18;
const unsigned char stop_mm = 40;

// Length of first MaxM light cycle in seconds
// The light scripts on the MaxMs MUST be

    return (hh * 60) + mm;
}

void ledOn (const Port ledPort, byte mask) {
  if (mask & 1) {
    ledPort.digiWrite(1);
  }
  if (mask & 2) {
    ledPort.digiWrite2(1);
  }
}

void ledOff (const Port ledPort, byte mask) {
  if (mask & 1) {
    ledPort.digiWrite(0);
  }
  if (mask & 2) {
    ledPort.digiWrite2(0);
  }
}

void doFlash(const Port ledPort, const byte mask, const byte cnt) {
#ifdef DEBUG_FLASH
    byte cntr = cnt;
    while (cntr > 0) {
        cntr--;
        ledOn(ledPort, mask);
        Sleepy::loseSomeTime(50);
        ledOff(ledPort, mask);
        if (cntr < 1) break;
        Sleepy::loseSomeTime(250);
    }
