sketch compiles when Uno board is selected but not when the micro board is??????

I’ve been running this sketch on the Uno with no problem but I just got a micro and tried to compile choosing a micro board and I get all these errors…what’s going on and how to fix???

timerinturrept_testing_6_8_14.ino: In function ‘void TIMER2_OVF_vect()’:
timerinturrept_testing_6_8_14:15: error: ‘TCNT2’ was not declared in this scope
timerinturrept_testing_6_8_14.ino: In function ‘void setup()’:
timerinturrept_testing_6_8_14:29: error: ‘TCCR2A’ was not declared in this scope
timerinturrept_testing_6_8_14:29: error: ‘CS22’ was not declared in this scope
timerinturrept_testing_6_8_14:30: error: ‘CS21’ was not declared in this scope
timerinturrept_testing_6_8_14:30: error: ‘CS20’ was not declared in this scope
timerinturrept_testing_6_8_14:32: error: ‘WGM21’ was not declared in this scope
timerinturrept_testing_6_8_14:32: error: ‘WGM20’ was not declared in this scope
timerinturrept_testing_6_8_14:34: error: ‘ASSR’ was not declared in this scope
timerinturrept_testing_6_8_14:34: error: ‘AS2’ was not declared in this scope
timerinturrept_testing_6_8_14:36: error: ‘TCNT2’ was not declared in this scope

#include <avr/interrupt.h>
#include <avr/io.h>

#define INIT_TIMER_COUNT 6
#define RESET_TIMER2 TCNT2 =INIT_TIMER_COUNT 

int ledPin = 13;
int int_counter = 0; //geartooth counter count up to time out
volatile int second = 0;
int oldSecond = 0;
long starttime = 0;
// Aruino runs at 16 Mhz, so we have 1000 Overflows per second...
// 1/ ((16000000 / 64) / 256) = 1 / 1000
ISR(TIMER2_OVF_vect) {
  RESET_TIMER2;
  int_counter += 1;
  if (int_counter == 10) //change here to increase/decrease timer check
  {
    second+=1;
    int_counter = 0;
    //Use counter var to count up to gearsensor time out
  } 
}

void setup() {
  Serial.begin(9600);
  Serial.println("Initializing timerinterrupt");
  //Timer2 Settings: Timer Prescaler /64, 
  TCCR2A |= (1<<CS22);    // turn on CS22 bit
  TCCR2A &= ~((1<<CS21) | (1<<CS20));    // turn off CS21 and CS20 bits
  // Use normal mode
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));   // turn off WGM21 and WGM20 bits
  // Use internal clock - external clock not used in Arduino
  ASSR |= (0<<AS2);
  TIMSK2 |= (1<<TOIE2) | (0<<OCIE2A);        //Timer2 Overflow Interrupt Enable  
  RESET_TIMER2;               
  sei();
  starttime = millis();
}

void loop() {
  
  
  if (oldSecond != second) {
    
    
    Serial.print(second);
    Serial.print(". ->");
    Serial.print(millis() - starttime);
    Serial.println(".");
    digitalWrite(ledPin, HIGH);
    
    delay(100);
    digitalWrite(ledPin, LOW);
    oldSecond = second;
  }
}

The micro does not have a timer2. Consult the datasheet to see what timers are available.

Thank You!!!

Moral of the story: if you prototype on a platform better than the ultimate target platform, remember to limit yourself to the target's abilities!