2005-2012 Microchip Technology Inc.
DS39747F-page 113
PIC24FJ128GA010 FAMILY
12.0
TIMER2/3 AND TIMER4/5
The Timer2/3 and Timer4/5 modules are 32-bit timers,
which can also be configured as four independent, 16-bit
timers with selectable operating modes.
As a 32-bit timer, Timer2/3 and Timer4/5 operate in
three modes:
Two Independent 16-Bit Timers (Timer2 and
Timer3) with All 16-Bit Operating modes
Single 32-Bit Timer
Single 32-Bit Synchronous Counter
They also support these features:
Timer Gate Operation
Selectable Prescaler Settings
Timer Operation During Idle and Sleep modes
Interrupt on a 32-Bit Period Register Match
A/D Event Trigger (Timer2/3 only)
Individually, all four of the 16-bit timers can function as
synchronous timers or counters. They also offer the
features listed above, except for the A/D Event Trigger;
this is implemented only with Timer3. The operating
modes and enabled features are determined by setting
the appropriate bit(s) in the T2CON, T3CON, T4CON
and T5CON registers. T2CON and T4CON are shown
in generic form in Register 12-1; T3CON and T5CON
are shown in Register 12-2.
For 32-bit timer/counter operation, Timer2 and Timer4
are the least significant word; Timer3 and Timer4 are
the most significant word of the 32-bit timers.
To configure Timer2/3 or Timer4/5 for 32-bit operation:
1.
Set the T32 bit (T2CON<3> or T4CON<3> = 1).
2.
Select the prescaler ratio for Timer2 or Timer4
using the TCKPS<1:0> bits.
3.
Set the Clock and Gating modes using the TCS
and TGATE bits.
4.
Load the timer period value. PR3 (or PR5) will
contain the most significant word of the value,
while PR2 (or PR4) contains the least significant
word.
5.
If interrupts are required, set the interrupt enable
bit, T3IE or T5IE. Use the interrupt priority bits,
T3IP<2:0> or T5IP<2:0>, to set the interrupt pri-
ority. Note that while Timer2 or Timer4 controls
the timer, the interrupt appears as a Timer3 or
Timer5 interrupt.
6.
Set the TON bit (= 1).
The timer value, at any point, is stored in the register
pair: TMR3:TMR2 (or TMR5:TMR4). TMR3 (TMR5)
always contains the most significant word of the count,
while TMR2 (TMR4) contains the least significant word.
To configure any of the timers for individual 16-bit
operation:
1.
Clear the T32 bit corresponding to that timer
(T2CON<3>
for
Timer2
and
Timer3
or
T4CON<3> for Timer4 and Timer5).
2.
Select the timer prescaler ratio using the
TCKPS<1:0> bits.
3.
Set the Clock and Gating modes using the TCS
and TGATE bits.
4.
Load the timer period value into the PRx register.
5.
If interrupts are required, set the interrupt enable
bit, TxIE; use the priority bits, TxIP<2:0>, to set
the interrupt priority.
6.
Set the TON bit (TxCON<15> = 1).
Note:
This data sheet summarizes the features of
this group of PIC24F devices. It is not
intended to be a comprehensive reference
source. Refer to Section 14. “Timers”
(DS39704)
in
the
“PIC24F
Family
Reference Manual”
for more information.
Note:
For 32-bit operation, T3CON and T5CON
control bits are ignored. Only T2CON and
T4CON control bits are used for setup and
control. Timer2 and Timer4 clock and gate
inputs are utilized for the 32-bit timer
modules, but an interrupt is generated
with the Timer3 or Timer5 interrupt flags.
相关PDF资料
PIC16F737-I/SP IC PIC MCU FLASH 4KX14 28DIP
PIC18F86K22-I/PTRSL MCU PIC 64K FLASH XLP 80TQFP
PIC16C63A-04I/SP IC MCU OTP 4KX14 PWM 28DIP
PIC16C63A-04I/SO IC MCU OTP 4KX14 PWM 28SOIC
52559-2270 CONN FFC 22POS .5MM VERT ZIF SMD
52559-1870 CONN FFC 18POS .5MM VERT ZIF SMD
DSPIC33EP64MC506-I/PT IC DSC 16BIT 64KB FLASH 64TQFP
52745-1896 CONN FFC 18POS .5MM R/A ZIF SMD
相关代理商/技术参数
PIC24FJ128GA008T-I/PF 制造商:MICROCHIP 制造商全称:Microchip Technology 功能描述:64/80/100-Pin General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA008T-I/PT 功能描述:16位微控制器 - MCU 128KB 69I/O RoHS:否 制造商:Texas Instruments 核心:RISC 处理器系列:MSP430FR572x 数据总线宽度:16 bit 最大时钟频率:24 MHz 程序存储器大小:8 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:VQFN-40 安装风格:SMD/SMT
PIC24FJ128GA010 制造商:MICROCHIP 制造商全称:Microchip Technology 功能描述:General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA010_09 制造商:MICROCHIP 制造商全称:Microchip Technology 功能描述:64/80/100-Pin General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA010_12 制造商:MICROCHIP 制造商全称:Microchip Technology 功能描述:64/80/100-Pin, General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA010-I/PF 功能描述:16位微控制器 - MCU 16 Bit 128KB Flash 8Kb RAM 53 I/O RoHS:否 制造商:Texas Instruments 核心:RISC 处理器系列:MSP430FR572x 数据总线宽度:16 bit 最大时钟频率:24 MHz 程序存储器大小:8 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:VQFN-40 安装风格:SMD/SMT
PIC24FJ128GA010-I/PT 功能描述:16位微控制器 - MCU 128KB 84 I/O RoHS:否 制造商:Texas Instruments 核心:RISC 处理器系列:MSP430FR572x 数据总线宽度:16 bit 最大时钟频率:24 MHz 程序存储器大小:8 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:2 V to 3.6 V 工作温度范围:- 40 C to + 85 C 封装 / 箱体:VQFN-40 安装风格:SMD/SMT
PIC24FJ128GA010T-I/PF 制造商:MICROCHIP 制造商全称:Microchip Technology 功能描述:64/80/100-Pin General Purpose, 16-Bit Flash Microcontrollers