Need some help on understanding why does delay affect timer1? ATTINY85

Hi guys, the following code runs well if i comment initTimer1() out. My expectation is to get the HELLO printed out after 5seconds. Why does it NOT work when I have initTimer1() uncommented?

I'm using ATTINY85 chip with 8MHz.

My understanding is that, whatever is declared in initTimer1, are all only related to timer1 and arduino uses Timer0 to do its delay functions.

I'm using attiny85 board info from the common place

Thank you!

Regards, Kuty

void setup() {
//  initTimer1();

static inline void initTimer1(void) {
  TCCR1 = 0;                  //stop the timer
  TCNT1 = 0;                  //zero the timer
  GTCCR = _BV(PSR1);          //reset the prescaler
  OCR1A = 243;                //set the compare value [0.5sec]
  TIMSK = _BV(OCIE1A);        //interrupt on Compare Match A

  //start timer, ctc mode, prescaler clk/16384
  TCCR1 = _BV(CTC1) | _BV(CS13) | _BV(CS12) | _BV(CS11) | _BV(CS10);

I found my error!


It is supposed to be |= OR!

otherwise, timer0 will be resetted!~