How to update a variable in an ISR using Timers
In CTC mode the top is OCR3A, not OCR3B!

After that TIMSK3 |= (1 &lt;&lt; OCIE3B); should also be changed to TIMSK3 |= (1 &lt;&lt; OCIE3A);, and ISR(TIMER3_COMPB_vect) to ISR(TIMER3_COMPA_vect)

For 3Hz, OCR3A should be 5208, not 20.

Technically TCCR3B |= (1 &lt;&lt; WGM12); should be TCCR3B |= (1 &lt;&lt; WGM32);