Microchip Technology Microstick for the 3V PIC24F K-series DM240013-1 DM240013-1 Data Sheet
Product codes
DM240013-1
2011 Microchip Technology Inc.
DS31037B-page 115
PIC24F16KL402 FAMILY
12.0
TIMER1
The Timer1 module is a 16-bit timer which can operate
as a free-running, interval timer/counter, or serve as the
time counter for a software-based Real-Time Clock
(RTC). Timer1 is only reset on initial V
as a free-running, interval timer/counter, or serve as the
time counter for a software-based Real-Time Clock
(RTC). Timer1 is only reset on initial V
DD
power-on
events. This allows the timer to continue operating as an
RTC clock source through other types of device Reset.
Timer1 can operate in three modes:
• 16-Bit Timer
• 16-Bit Synchronous Counter
• 16-Bit Asynchronous Counter
Timer1 also supports these features:
• Timer Gate Operation
• Selectable Prescaler Settings
• Timer Operation During CPU Idle and Sleep modes
• Interrupt on 16-Bit Period Register Match or
RTC clock source through other types of device Reset.
Timer1 can operate in three modes:
• 16-Bit Timer
• 16-Bit Synchronous Counter
• 16-Bit Asynchronous Counter
Timer1 also supports these features:
• Timer Gate Operation
• Selectable Prescaler Settings
• Timer Operation During CPU Idle and Sleep modes
• Interrupt on 16-Bit Period Register Match or
Falling Edge of External Gate Signal
illustrates a block diagram of the 16-bit
Timer1 module.
To configure Timer1 for operation:
1.
To configure Timer1 for operation:
1.
Set the TON bit (= 1).
2.
Select the timer prescaler ratio using the
TCKPS<1:0> bits.
TCKPS<1:0> bits.
3.
Set the Clock and Gating modes using the TCS
and TGATE bits.
and TGATE bits.
4.
Set or clear the TSYNC bit to configure
synchronous or asynchronous operation.
synchronous or asynchronous operation.
5.
Load the timer period value into the PR1
register.
register.
6.
If interrupts are required, set the interrupt enable
bit, T1IE. Use the priority bits, T1IP<2:0>, to set
the interrupt priority.
bit, T1IE. Use the priority bits, T1IP<2:0>, to set
the interrupt priority.
FIGURE 12-1:
16-BIT TIMER1 MODULE BLOCK DIAGRAM
Note:
This data sheet summarizes the features
of this group of PIC24F devices. It is not
intended to be a comprehensive refer-
ence source. For more information on
Timers, refer to the “PIC24F Family Refer-
ence Manual”
of this group of PIC24F devices. It is not
intended to be a comprehensive refer-
ence source. For more information on
Timers, refer to the “PIC24F Family Refer-
ence Manual”
, Section 14. “Timers”
(DS39704).
TON
Sync
SOSCI
SOSCO/
PR1
Set T1IF
Equal
Comparator
TMR1
Reset
SOSCEN
1
0
TSYNC
Q
Q
D
CK
TCKPS<1:0>
Prescaler
1, 8, 64, 256
2
TGATE
T
CY
1
0
T1CK
TCS
1x
01
TGATE
00
Gate
Sync