Timer1 module is a 16-bit timer/counter, which means that it consists of two registers (TMR1L and TMR1H). It is capable of counting up to 65.535 pulses in a single cycle, i.e. before the counting starts from zero.
|32 kHz||33 pF||33 pF|
|100 kHz||15 pF||15 pF|
|200 kHz||15 pF||15 pF|
' In this example, Timer1 is configured as a timer with the prescaler rate 1:8. Every time ' TMR1H and TMR1L registers overflow occurs, an interrupt will be requested. main: ... PIR1.TMR1IF = 0 ' Reset the TMR1IF flag bit TMR1H = 0x22 ' Set initial value for the Timer1 TMR1L = 0x00 T1CON.TMR1CS = 0 ' Timer1 counts pulses from internal oscillator T1CON.T1CKPS0 = 1 ' Assigned prescaler rate is 1:8 T1CON.T1CKPS1 = 1 PIE1.TMR1IE = 1 ' Enable interrupt on overflow INTCON = 0xC0 ' Enable interrupt (bits GIE and PEIE) T1CON.TMR1ON = 1 ' Turn the Timer1 on ...