The Timer0 module is used here with the PIC MCU to generate an interrupt when the TMR0 register overflows. This will force the interrupts to occur at a fixed rate. A change in square wave frequency can be detected by observing a change in the TMR1 registers’ values on each TMR0 interrupt.