Datasheet

© 2005 Microchip Technology Inc. DS70043F-page 25
dsPIC30F
9.2 General Purpose Timer Modules
The General Purpose (GP) Timer modules provide the
time base elements for Input Capture and Output
Compare/PWM. They can be configured for real-time
clock operation as well as various timer/counter
modes. The timer modes count pulses of the internal
time base, whereas counter modes count external
pulses that appear on the Timer Clock pin.
The dsPIC30F device supports up to five 16-bit timers
(Timer1 through Timer5). Four of the 16-bit timers can
be configured as two 32-bit timers (Timer2/3 and 4/5).
Each timer has several selectable operating modes.
9.2.1 TIMER1
The Timer1 module (Figure 9-1) is a 16-bit timer that
can serve as the time counter for an asynchronous
real-time clock, or operate as a free-running interval
timer/counter. The 16-bit timer has the following
modes:
16-bit Timer
16-bit Synchronous Counter
16-bit Asynchronous Counter
Further, the following operational characteristics are
supported:
Timer gated by external pulse
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
Timer1, when operating in Real-Time Clock (RTC)
mode, provides time of day and event time-stamping
capabilities. Key operational features of the RTC are:
Operation from 32 kHz LP oscillator
8-bit prescaler
•Low power
Real-Time Clock interrupts
FIGURE 9-1: 16-BIT TIMER1 MODULE BLOCK DIAGRAM
TON
Sync
SOSCI
SOSCO/
PR1
T1IF
Equal
Comparator x 16
TMR1
Reset
LPOSCEN
Event Flag
1
0
TSYNC
Q
Q
D
CK
TGATE
TCKPS<1:0>
Prescaler
1, 8, 64, 256
2
TGATE
T
CY
1
0
T1CK
TCS
1 x
0 1
TGATE
0 0
Gate
Sync