Manipulating Timer1 appears to affect micros() millis()

Arduino Mega

My understanding is that micros() and millis() work off of Timer0. Thus it would seem to me that using Timer1 should have no effect on their output. Using the code below, if OCR1A = 2000 then the output of micros() and millis() (as written to Serial.print()) seems to be as expected, and reflects timing that is right on the money.

However, if I set OCR1A = 20, output of micro() begins to increase to a point, then “randomly” decreases and increases, never seeming to get above a value of about 2000 and something. The output of millis() goes from 0 to 1, then never increases above 1.

If micros() and millis() work off of Timer0, then why would they be affected by anything I do with Timer1?

void setup() {
  // For diagnostics.
  Serial.begin(9600);
  Serial.println("Starting up...");

  noInterrupts();

  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1  = 0;
  OCR1A = 2000;
  
  // turn on CTC mode
  TCCR1B |= (1 << WGM12);
  
  // Set CS12 bit for 256 prescaler
  TCCR1B |= (1 << CS12);  
  
  // enable timer compare interrupt
  TIMSK1 |= (1 << OCIE1A);
  
  interrupts();//allow interrupts
}

ISR(TIMER1_COMPA_vect) {
  Serial.print(micros());
  Serial.print("    ");
  Serial.println(millis());

  //TCNT1 = 0;
}

void loop() {
}

(On a side note, I have to comment out the TCNT1 = 0 (resetting of the counter value) after each run of the ISR otherwise I get inaccurate results. I don’t know why that is.)

are you really printing from an ISR ?(and at 9600 bauds...) and expect to have things work out OK?

(when you are in an ISR interrupts are blocked and Serial works with interruptions. And when the 64 byte Serial buffer is full, print becomes a blocking function...)

J-M-L:
are you really printing from an ISR ?(and at 9600 bauds...) and expect to have things work out OK?

(when you are in an ISR interrupts are blocked and Serial works with interruptions. And when the 64 byte Serial buffer is full, print becomes a blocking function...)

Ah, much better, thank you.