Device-Level Timers
MSC8144E Reference Manual, Rev. 3
Freescale Semiconductor
21-9
Set up the Timer Status and Control Register (TMRxSCTL) bits as follows:
Output Polarity Select (OPS) = Your choice, true (0) or inverted (1).
Output Enable (OEN) = 1 to enable the timer output to be put on an external pin. Set this
bit as needed.
Ensure that the rest of the TMRxSCTL bits are cleared. Interrupts are enabled in the Timer
Comparator Status and Control Register (TMRxCOMSC) instead of in this register.
Set up the Timer Comparator Status and Control Register (TMRxCOMSC) bits as follows:
Timer Compare 2 Interrupt Enable (TCF2EN) = 1 to allow an interrupt to be issued when
TCF2 is set).
Timer Compare1 Interrupt Enable (TCF1EN) = 0 so that an interrupt cannot be issued
when TCF1 is set.
Timer Compare 1 Interrupt Source (TCF1) = 0 to clear the timer compare 1 interrupt
source flag. This bit is set when a successful comparison of the timer and the TMRxCMP1
register occurs.
Timer Compare 2 Interrupt Source (TCF2) = 0 to clear the timer compare 2 interrupt
source flag. This bit is set when a successful comparison of the timer and the TMRxCMP2
register occurs.
Compare Load Control 1 (CL1) = 10 to load the compare register when TCF2 is set.
Compare Load Control 2 (CL2) = 01 to load the compare register when TCF1 is set.
To service the TCF2 interrupts generated by the Timer, the interrupt controller must be
configured to enable the interrupts for the timer being used. Additionally, you must write an
interrupt service routine to do at least the following:
Clear the TCF2 and TCF1 flags.
Calculate and write new values for TMRxCMPLD1[15–0] and TMRxCMPLD2[15–0].
Figure 21-3 shows the timing for the compare preload cycle, which begins when a compare
event on TMRxCMP2 causes TCF2 to be set. TMRxCMP1 is loaded with the value in the
TMRxCMPLD1 one internal bus clock later. In addition, the timer asserts an interrupt, and the
interrupt service routine executes while both comparator load registers are updated with new
values. When TCF1 is set, TMRxCMP2 is loaded with the value of the CLV2 bits in
TMRxCMPLD2. During the subsequent TCF2 event, TMRxCMP1 is loaded with the value of
the TMRxCMPLD1[CLV1] bits. The cycle starts over again as an interrupt is asserted and the
interrupt service routine clears TCF1 and TCF2 and calculates new values for TMRxCMPLD1
and TMRxCMPLD2.
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 ...