MSC8144E Reference Manual, Rev. 3
21-10
Freescale
Semiconductor
Timers
Figure 21-3. Compare Preload Timing
21.1.5 Timer Compare Functionality
The compare registers (TMRxCMP1 and TMRxCMP2) provide a bidirectional modulo count
capability. TMRxCMP1 is used when the timer is counting up. Program it with the desired
maximum count value or to 0xFFFF to indicate the maximum un signed value prior to roll-over.
TMRxCMP2 is used when the timer is counting down. Program it with the maximum negative
count value or to 0x0000 to indicate the minimum unsigned value prior to roll-under. The only
exception occurs when the timer is operating with alternating compare registers.
When TMRxCTL[OFLM] = 100, alternating values of TMRxCMP1 and TMRxCMP2 are used
to generate successful compares, and the output flag toggles while using alternating compare
registers. For example, when TMRxCTL[OFLM] = 100, the timer is programmed to count
upwards. It counts until the TMRxCMP1 value is reached, reinitializes, then counts until the
TMRxCMP2 value is reached, reinitializes, then counts until the TMRxCMP1 value is reached,
and so on. In this Variable Frequency PWM mode, the TMRxCMP2 value defines the desired
pulse width of the on-time, and the TMRxCMP1 register defines the off-time. The Variable
Frequency PWM mode is defined for positive counting only. See Section 21.1.4.4, Variable
Frequency PWM Mode, on page 21-8.
Use caution when changing TMRxCMP1 and TMRxCMP2 while the timer is active. If the timer
has already passed the new value, it counts to 0xFFFF or 0x0000, rolls over/under, and then
begins counting toward the new value. The check is for Count = TMRxCMPx, not Count > =
TMRxCMP1 or Count < = TMRxCMP2). Use of the preload registers addresses this problem.
1
Compare Preload Cycle
3
ci1-1
ci1
0
1
c0-n
c0-1
c0
0
1
c2-1
c2
0
ci0
c0
c1
ci1
c2
c0
c1
ci1
c2
Internal Bus Clock
Counter[15–0]
TMRxCMP1[15–0]
TMRxCMP2[15–0]
TCF1
TCF2
TMRxCMPLD1[15–0]
TMRxCMPLD2[15–0]
Output Flag
Summary of Contents for MSC8144E
Page 1: ...MSC8144E Reference Manual Quad Core Media Signal Processor MSC8144ERM Rev 3 July 2009 ...
Page 48: ...MSC8144E Reference Manual Rev 3 xlviii Freescale Semiconductor ...
Page 86: ...MSC8144E Reference Manual Rev 3 1 38 Freescale Semiconductor Overview ...
Page 168: ...MSC8144E Reference Manual Rev 3 3 60 Freescale Semiconductor External Signals ...
Page 242: ...MSC8144E Reference Manual Rev 3 5 26 Freescale Semiconductor Reset ...
Page 314: ...MSC8144E Reference Manual Rev 3 8 24 Freescale Semiconductor General Configuration Registers ...
Page 414: ...MSC8144E Reference Manual Rev 3 10 14 Freescale Semiconductor MSC8144E SC3400 DSP Subsystem ...
Page 452: ...MSC8144E Reference Manual Rev 3 11 38 Freescale Semiconductor Internal Memory Subsystem ...
Page 520: ...MSC8144E Reference Manual Rev 3 12 68 Freescale Semiconductor DDR SDRAM Memory Controller ...
Page 1070: ...MSC8144E Reference Manual Rev 3 21 28 Freescale Semiconductor Timers ...