UNO Timer 1 CTC mode not resetting TCNT1 I'm trying to set up timer 1 to run an isr in CTC mode. no matter what i set OCR1A to it always executes at the same frequency and if i print out TCNT1 I get values higher than OCR1A.

here is my Code

    void timer1_init()
    {
    // set up timer with prescaler = 8 and CTC mode
    TCCR1B |= (1 &lt;&lt; WGM12)|(0 &lt;&lt; CS12)|(1 &lt;&lt; CS11)|(0 &lt;&lt; CS10);

    // initialize counter
    TCNT1 = 0;

    // initialize compare value
    OCR1A = 100;

    // enable compare interrupt
    TIMSK1 |= (1 &lt;&lt; OCIE1A);



      // enable global interrupts
        sei();
    }

ISR(TIMER1_COMPA_vect){
    SET(MOTOR_PORT,LEFT_MOTOR_STEP); //set the pin high
    delayMicroseconds(3); //keep high for a bit
    CLR(MOTOR_PORT,LEFT_MOTOR_STEP); //set it low
}


I'm using this to drive a stepper motor so using PWM mode wont work.
It sounds as though timer 1 has not in fact been set to wavegen mode 4. You can ensure that it is by also clearing the other bits of WGM1:

TCCR1A &amp;= ~(_BV(WGM10) | _BV(WGM11));
TCCR1B &amp;= ~_BV(WGM13);