Setting the sampling rate for timer interrupt
// = 16000000 / (8 * 50) - 1 (must be &lt;65536) that 8 in the formula refers to the prescaler. So this formula expect you to have a /8 prescaler. But four lines below you used a /64 prescaler. So your timer runs 6.25 Hz.

When you changed it to /8, you got the correct frequency.