Datasheet
PIC18F66K80 FAMILY
DS39977F-page 226 2010-2012 Microchip Technology Inc.
16.2 Timer3 Operation
Timer3 can operate in these modes:
•Timer
• Synchronous Counter
• Asynchronous Counter
• Timer with Gated Control
The operating mode is determined by the clock select
bits, TMR3CSx (T3CON<7:6>). When the TMR3CSx bits
are cleared (=
00), Timer3 increments on every internal
instruction cycle (F
OSC/4). When TMR3CSx = 01, the
Timer3 clock source is the system clock (F
OSC), and
when it is ‘
10’, Timer3 works as a counter from the
external clock from the T3CKI pin (on the rising edge
after the first falling edge) or the SOSC oscillator.
FIGURE 16-1: TIMER3 BLOCK DIAGRAM
TMR3H TMR3L
T3SYNC
T3CKPS<1:0>
0
1
Synchronized
Clock Input
2
Set Flag bit,
TMR3IF, on
Overflow
TMR3
(2)
TMR3ON
Note 1: ST Buffer is high-speed type when using T3CKI.
2: Timer3 registers increment on rising edge.
3: Synchronization does not operate while in Sleep.
4: The output of SOSC is determined by the SOSCSEL<1:0> Configuration bits.
T3G
FOSC/4
Internal
Clock
SOSCO/SCLKI
SOSCI
1
0
T3CKI
TMR3CS<1:0>
(1)
Sleep Input
TMR3GE
0
1
00
01
10
11
From TMR4
From Comparator 1
T3GPOL
D
Q
CK
Q
0
1
T3GVAL
T3GTM
T3GSPM
T3GGO/T3DONE
T3GSS<1:0>
10
00
01
FOSC
Internal
Clock
From Comparator 2
Output
Match PR4
R
D
EN
Q
Q1
RD
T3GCON
Data Bus
Interrupt
TMR3GIF
Set
T3CLK
FOSC/2
Internal
Clock
D
EN
Q
T3G_IN
TMR3ON
Output
T1CON.SOSCEN
T3CON.SOSCEN
SOSCGO
SCS<1:0> = 01
EN
OUT
(4)
SOSC
Single Pulse
Acq. Control
Synchronize
(3)
det
Prescaler
1, 2, 4, 8
det