MSC8113 Reference Manual, Rev. 0
Freescale Semiconductor
22-7
Figure 22-3 illustrates an example of simple counting using one timer in which the timer counter
receives its clock from an external clock. It also illustrates how to restart the timer by writing 1 to
the TCR. The configuration registers are:
TGCRA[INTP] = 0, TGCRA[TOG] = 1
TCFRA0[CYC] = 1, TCFRA0[IPOL] = 0
TIER[IE0] = 1
TCMPA0[COMPVAL] = 0x0123
Timer Actions:
Once enabled, the timer starts counting from 0 to the value
specified in the timer compare register. The first two cycles of
the counter clock (can be checked by polling the TSRx) are
lost after the bit is set to 1.
Timer Compare Register A
(TCMPA)
COMPVAL field.
When it reaches the value in the compare register, the timer
sets a bit in the event register.
Timer Event Register A (TERA)
CFx = 1.
An interrupt is generated.
Timer Interrupt Mask Register A
(TIERA)
IEx = 1.
Programmer Actions While Running:
Restart the counter at any time by writing a 1 to the enable bit
in the TCRAx (see the note on page 22-16).
Timer Control Register A (TCRA).
Read the value of the timer internal counter at any time.
Timer Count Register A (TCNRA)
CNTVAL field.
Disable a timer by clearing the TE bit in the TCRAx register.
To reconfigure the timer, write new value to the configuration
registers and set the TE bit. The timer counter resets and
starts counting from 0 (see the note on page 22-16).
Timer Control Register A (TCRA)
TE bit = 0.
Figure 22-3. Counting Example
Table 22-3. Timer Actions (Continued)
Actions
Register
Page
BUSES_CLOCK
External clock
Counter
0x11f
0x120 0x121 0x122
0x000
0x001 0x002 0x003 0x004 0x005 0x006
0x000
TER
0x0000
0x0001
Interrupt
Timer 0
Write 1 to TCR0
Summary of Contents for MSC8113
Page 1: ...MSC8113 Reference Manual Tri Core 16 Bit Digital Signal Processor MSC8113RM Rev 0 May 2008 ...
Page 20: ...MSC8113 Reference Manual Rev 0 xx Freescale Semiconductor Contents ...
Page 28: ...MSC8113 Reference Manual Rev 0 xxviii Freescale Semiconductor ...
Page 56: ...MSC8113 Reference Manual Rev 0 1 28 Freescale Semiconductor MSC8113 Overview ...
Page 76: ...MSC8113 Reference Manual Rev 0 2 20 Freescale Semiconductor SC140 Core Overview ...
Page 134: ...MSC8113 Reference Manual Rev 0 4 30 Freescale Semiconductor System Interface Unit SIU ...
Page 168: ...MSC8113 Reference Manual Rev 0 6 18 Freescale Semiconductor Boot Program ...
Page 180: ...MSC8113 Reference Manual Rev 0 7 12 Freescale Semiconductor Clocks ...
Page 260: ...MSC8113 Reference Manual Rev 0 8 80 Freescale Semiconductor Memory Map ...
Page 300: ...MSC8113 Reference Manual Rev 0 9 40 Freescale Semiconductor Extended Core ...
Page 304: ...MSC8113 Reference Manual Rev 0 10 4 Freescale Semiconductor MQBus and M2 Memory ...
Page 308: ...MSC8113 Reference Manual Rev 0 11 4 Freescale Semiconductor SQBus ...
Page 590: ...MSC8113 Reference Manual Rev 0 17 46 Freescale Semiconductor Interrupt Processing ...
Page 614: ...MSC8113 Reference Manual Rev 0 18 24 Freescale Semiconductor Debugging ...
Page 622: ...MSC8113 Reference Manual Rev 0 19 8 Freescale Semiconductor Internal Peripheral Bus IPBus ...
Page 724: ...MSC8113 Reference Manual Rev 0 21 32 Freescale Semiconductor UART ...
Page 920: ...MSC8113 Reference Manual Rev 0 25 150 Freescale Semiconductor Ethernet Controller ...
Page 1171: ...MSC8113 Reference Manual Rev 0 Freescale Semiconductor C 61 EF wait_rts P 01077FFC 9F rts 71 ...
Page 1172: ...MSC8113 Reference Manual Rev 0 C 62 Freescale Semiconductor MSC8113 Boot Code ...
Page 1202: ...MSC8113 Reference Manual Rev 0 Index 30 Freescale Semiconductor Index ...