EasyManua.ls Logo

Microchip Technology dsPIC30F - 32-Bit Timer Configuration

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
dsPIC30F Family Reference Manual
DS70059C-page 12-16 © 2004 Microchip Technology Inc.
12.9 32-bit Timer Configuration
A 32-bit timer module can be formed by combining a Type B and a Type C 16-bit timer module.
The Type C time base becomes the MSWord of the combined timer and the Type B time base is
the LSWord.
When configured for 32-bit operation, the control bits for the Type B time base control the operation
of the 32-bit timer. The control bits in the TxCON register for the Type C time base have no effect.
For interrupt control, the combined 32-bit timer uses the interrupt enable, interrupt flag and
interrupt priority control bits of the Type C time base. The interrupt control and status bits for the
Type B time base are not used during 32-bit timer operation.
The following configuration settings assume Timer3 is a Type C time base and Timer2 is a Type B
time base:
TON (T2CON<15>) = 1.
T32 (T2CON<3>) = 1.
TCKPS<1:0> (T2CON<5:4>) are used to set the Prescaler mode for Timer2
(Type B time base).
The TMR3:TMR2 register pair contains the 32-bit value of the timer module; the TMR3
(Type C time base) register is the Most Significant Word, while the TMR2 (Type B time
base) register is the Least Significant Word of the 32-bit timer value.
The PR3:PR2 register pair contains the 32-bit period value that is used for comparison with
the TMR3:TMR2 timer value.
T3IE (IEC0<7>) is used to enable the 32-bit timer interrupt for this configuration.
T3IF (IFS0<7>) is used as a status flag for the timer interrupt.
T3IP<2:0> (IPC1<14:12>) sets the interrupt priority level for the 32-bit timer.
T3CON<15:0> are “don’t care” bits.
A block diagram representation of the 32-bit timer module using Timer2 and Timer3 as an
example is shown in Figure 12-6.
Note: Refer to the device data sheet for information on the specific Type B and Type C
time bases that can be combined.

Table of Contents

Other manuals for Microchip Technology dsPIC30F