 // -------------------------
 //        Settings
 // -------------------------
-const bool debug = true;        //true = write to serial monitor, false = bypass
-const int serialOutLoops = 5;   //Number of loops that should execute before a serial write
+const bool debug = true;       //true = write to serial monitor, false = bypass
+const int serialOutLoops = 000; //Number of loops that should execute before a serial write
 //Ignition Settings
 const int dwell = 2500;         //Ignition coil charging dwell in microseconds (2.5ms = 2500us)
-const long periodMax = 1000000; //Maximum period between ignitions, in microseconds (min frequency)
+const long periodMax = 2000000; //Maximum period between ignitions, in microseconds (min frequency)
 const long periodMin = 5000;    //Minimum period between ignitions, in microseconds (max frequency)
 const int periodCorrection = 0; //Variance to period due to loop code execution time (milliseconds)
 const float linearity = 2.5;    //1.0 = linear, 0.5 = more resolution in the high end, 2.0 = more resolution in the low end (exponential)
 const bool triggerHigh = true;  //true = HIGH to fire, false = LOW to fire
 //Multifire Settings
-const bool multiFire = true;    //true = fire [firingCount] times per period, false = fire once per period
+const bool multiFire = false;    //true = fire [firingCount] times per period, false = fire once per period
 const int multiCount = 3;       //Numeber of sparks to fire per event
 const int multiDelay = 2000;    //Delay between multifires in microseconds (2ms = 2000us)
 //Tachometer Settings
 const int tachTrim = -30;        //Ticks to trim off the tach durations
+const long tachStale = 100000;   //Ticks after which the tach signal is 'stale'
+const byte activeState = LOW;    //State of activation pin that determines active
 
 // -------------------------
 //     Global Variables
 // -------------------------
 volatile bool active = false;
+byte ignitionMode = OFF;
+volatile bool updateTimer = true;
+volatile unsigned long tachPrevious = 0;
+volatile unsigned long tachCurrent = 0;
+unsigned long tachDuration0 = 0;
+unsigned long tachDuration1 = 0;
+unsigned long tachDuration2 = 0;
 unsigned int rpm = 0;
-volatile unsigned long tachDuration0 = 0;
-volatile unsigned long tachDuration1 = 0;
-volatile unsigned long tachDuration2 = 0;
-volatile unsigned long tachLast = 0;
-volatile byte ignitionMode = OFF;
-volatile byte remainingCount = 0;
-volatile bool updateTimer = false;
+byte remainingCount = 0;
 int loopsSinceSerialWrite = 0;
 long period = 0;
+
+int timerCount = 0;
 
 // -------------------------
 //      Initialization

  long result;
  // Read 1.1V reference against AVcc
  ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
  delay(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Convert
  while (bit_is_set(ADCSRA,ADSC));
  result = ADCL;

  long result;
  // Read temperature sensor against 1.1V reference
  ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
  delayFixed(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Convert
  while (bit_is_set(ADCSRA,ADSC));
  result = ADCL;
