4.
Configure the output state of the PWM signal (whether or not it is inverted) in the
TnPWML
field
of the
GPTM Control (GPTMCTL)
register.
5.
If a prescaler is to be used, write the prescale value to the
GPTM Timer n Prescale Register
(GPTMTnPR)
.
6.
If PWM interrupts are used, configure the interrupt condition in the
TnEVENT
field in the
GPTMCTL
register and enable the interrupts by setting the
TnPWMIE
bit in the
GPTMTnMR
register. Note that edge detect interrupt behavior is reversed when the PWM output is inverted
(see page 986).
7.
Load the timer start value into the
GPTM Timer n Interval Load (GPTMTnILR)
register.
8.
Load the
GPTM Timer n Match (GPTMTnMATCHR)
register with the match value.
9.
Set the
TnEN
bit in the
GPTM Control (GPTMCTL)
register to enable the timer and begin
generation of the output PWM signal.
In PWM Time mode, the timer continues running after the PWM signal has been generated. The
PWM period can be adjusted at any time by writing the
GPTMTnILR
register, and the change takes
effect at the next cycle after the write.
13.5
Register Map
Table 13-11 on page 974 lists the GPTM registers. The offset listed is a hexadecimal increment to
the register's address, relative to that timer's base address:
■ 16/32-bit Timer 0: 0x4003.0000
■ 16/32-bit Timer 1: 0x4003.1000
■ 16/32-bit Timer 2: 0x4003.2000
■ 16/32-bit Timer 3: 0x4003.3000
■ 16/32-bit Timer 4: 0x4003.4000
■ 16/32-bit Timer 5: 0x4003.5000
■ 16/32-bit Timer 6: 0x400E.0000
■ 16/32-bit Timer 7: 0x400E.1000
Note that the GP Timer module clock must be enabled before the registers can be programmed
(see page 380). There must be a delay of 3 system clocks after the Timer module clock is enabled
before any Timer module registers are accessed.
Table 13-11. Timers Register Map
See
page
Description
Reset
Type
Name
Offset
GPTM Configuration
0x0000.0000
RW
GPTMCFG
0x000
GPTM Timer A Mode
0x0000.0000
RW
GPTMTAMR
0x004
GPTM Timer B Mode
0x0000.0000
RW
GPTMTBMR
0x008
GPTM Control
0x0000.0000
RW
GPTMCTL
0x00C
GPTM Synchronize
0x0000.0000
RW
GPTMSYNC
0x010
GPTM Interrupt Mask
0x0000.0000
RW
GPTMIMR
0x018
June 18, 2014
974
Texas Instruments-Production Data
General-Purpose Timers