Share with:


Once you define an ISR bit in the TIMSKx, the appropriate ISR must be attached.

Lost almost a day on non functioning serial port, until stumbled upon the post in stackoverflow.com

So, when copypasting

TIMSK1 |= (1 << TOIE1) | (1 << OCIE1A);

be sure to define both
ISR(TIMER1_OVF_vect) {
...
}

and
ISR (TIMER1_COMPA_vect)
{
...
}