Timer 3 is not working properly

I have two megas 2560 and one is with clock speed of 12 MHz crystal other with 16 MHz.
It seems my setup of timer 3 is not same for those two megas (Attachinterrupt have different counts )

I have this setup of timer 3 (Those timers setup are "dark India" for me...)

    TIMSK3 &= ~(1 << TOIE3);
    /* Configure timer3 in normal mode (pure counting, no PWM etc.) */
    TCCR3A &= ~((1 << WGM31) | (1 << WGM30));
    TCCR3B &= ~(1 << WGM32);

    TCCR3A = TCCR3A | (1 << COM3A1) | (1 << COM3B1) | (1 << COM3C1);

    /* Disable Compare Match A interrupt enable (only want overflow) */
    TIMSK3 &= ~(1 << OCIE3A);

    /* Now configure the prescaler to CPU clock divided by 128 */
    TCCR3B |= (1 << CS32) | (1 << CS30);    // Set bits
    TCCR3B &= ~(1 << CS31);                 // Clear bit
    
    sbi(TCCR3B, CS32);        // CS31 set prescaler to 256 and start the timer
    sbi(TCCR3A, WGM30);       // put timer 3 in 8-bit phase correct pwm mode

    sei();//allow interrupts

How to change the timer setting to be the same for both?
Or i have some other issue ... Mega2560 with 12MHz crystal works with breadboard and correct counting other with 16MHz and PCB board have a lower count of interrupts (Strangely slower).

Well, one would expect a 12mhz mega2560's timers to run more slowly, since it's clocked off the system clock.

Since you've posted only a tiny snippet of the code, and no description of what is different between the behavior of the two, there's not much else we can say.

The function of the timer registers is described in section 17 of the datasheet.

I expect 12 mhz mega2560's to work slowly but my problem is opposed...
Mega's 12MHz's cristal works fine and Mega with 16MHz's crystal handles the pulses like there is no TIMER3 setup. Other other of the code is simple counting FALLING (edge) with attachedInterrupt

I'm counting engine RPMs

For 800 RPMs

Mega 12MHz counts ~20 pulses
Mega 16MHz counts ~6 pulses

Arduino sketch is same
I'm also wondering is there some chance to be corrupted timer or some noise ????

Okay, and where did you say you posted your code?

DrAzzy:
Okay, and where did you say you posted your code?

I'll accept this as answer for correct Timer3 setup...

The code is here: the source code