Uno Timer2 Interrupts

Hey all,

Trying to get timer2 interrupts working for my UNO. Here is my current code I’m using:

#include <Wire.h>

volatile uint16_t setbit = 0;

void setup()
{
  Serial.begin(115200);
  
  
  
 
 
  // initialize timer2
  noInterrupts();           // disable all interrupts
  TCCR2A = 0;
  TCCR2B = 0;     
  TCNT2 = 0;

  OCR2A = 157;            // compare match register 16MHz/1024/100Hz = 156.25 < 256 OK!
  TCCR2B |= (1 << WGM12);   // CTC mode
  TCCR2B |= (1 << CS10);    // 1024 prescaler
  TCCR2B |= (1 << CS12);    // 1024 prescaler
 
  TIMSK2 |= (1 << OCIE2A);  // enable timer compare interrupt 
  interrupts();             // enable all interrupts 
}

ISR(TIMER2_COMPA_vect)          // timer compare interrupt service routine
{
  setbit=1; 
}

void loop()
{
  if (setbit==0)
  {
    //Serial.println("Loop");
  }
  
  if (setbit==1)
  {
  Serial.print("Interrupt "); Serial.println(millis()); //Serial print the current millis 
  setbit = 0;
  }
}

This should call an interrupt every 10ms (100hz). Instead I’m getting the following output:

Interrupt 1
Interrupt 3
Interrupt 5
Interrupt 7
Interrupt 9
Interrupt 11
Interrupt 13
Interrupt 15
Interrupt 17
Interrupt 19
Interrupt 21
Interrupt 23
Interrupt 25
Interrupt 27
Interrupt 29
Interrupt 31
Interrupt 33
Interrupt 35
Interrupt 37

I would expect to see

Interrupt 1
Interrupt 11
Interrupt 21

etc.

Any thoughts on what I could be doing wrong? Really struggling with this…

Jim