PIC16C62B/72A
Additional information on timer modules is available in
the PICmicro™ Mid-Range Reference Manual,
(DS33023).
6.0
TIMER2 MODULE
The Timer2 module timer has the following features:
• 8-bit timer (TMR2 register)
FIGURE 6-1: TIMER2 BLOCK DIAGRAM
- Readable and writable
• 8-bit period register (PR2)
Sets flag
TMR2
output (1)
bit TMR2IF
- Readable and writable
• Software programmable prescaler (1:1, 1:4, 1:16)
• Software programmable postscaler (1:1 to 1:16)
• Interrupt on match (TMR2 = PR2)
• Timer2 can be used by SSP and CCP
Reset
Prescaler
1:1, 1:4, 1:16
TMR2 reg
FOSC/4
Postscaler
2
Comparator
1:1 to 1:16
EQ
Timer2 has a control register, shown in Register 6-1.
Timer2 can be shut off by clearing control bit TMR2ON
(T2CON<2>) to minimize power consumption.
4
PR2 reg
Figure 6-1 is a simplified block diagram of the Timer2
module.
Note 1: TMR2 register output can be software selected
by the SSP Module as a baud clock.
REGISTER 6-1:T2CON: TIMER2 CONTROL REGISTER (ADDRESS 12h)
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
—
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0
bit0
R
= Readable bit
W = Writable bit
U
bit7
= Unimplemented bit,
read as ‘0’
- n = Value at POR reset
bit 7:
Unimplemented: Read as '0'
bit 6-3: TOUTPS3:TOUTPS0: Timer2 Output Postscale Select bits
0000= 1:1 Postscale
0001= 1:2 Postscale
0010= 1:3 Postscale
•
•
•
1111= 1:16 Postscale
bit 2:
TMR2ON: Timer2 On bit
1 = Timer2 is on
0 = Timer2 is off
bit 1-0: T2CKPS1:T2CKPS0: Timer2 Clock Prescale Select bits
00= Prescaler is 1
01= Prescaler is 4
1x= Prescaler is 16
1999 Microchip Technology Inc.
Preliminary
DS35008B-page 31