Midi Clock

  TCNT3 = 65536;

You can't fit 65536 into 16 bits. The largest you can fit is 65535.