MC68F375
CONFIGURABLE TIMER MODULE (CTM9)
MOTOROLA
REFERENCE MANUAL
Rev. 25 June 03
13-57
seconds can be measured. Note that a software option is provided to also generate an
interrupt after the first edge.
In the example shown in Figure 13-16, a counter submodule is used as the time-base
for a DASM configured in the input pulse width measurement mode. When the leading
edge (programmed for either rising or falling edge) of the input signal occurs, the state
of the time-base bus is saved in register B1. When the trailing edge occurs, the time-
base bus is latched into register A, and the content of register B1 is transferred to reg-
ister B2. This operation leaves register B1 free for the next leading edge to occur, as
soon as on the next clock cycle. When enabled, an interrupt is provided after the trail-
ing edge, to notify the software that pulse width measurement data is available for a
new pulse. After the trailing edge, the software has one cycle time of the input signal
to obtain the values for each edge. When software attention is not needed for every
pulse, the interrupt can be disabled. The software can at any time read registers A and
B2 coherently (using a 32-bit read instruction) to get the latest edge measurements.
Since the measurement resolution is 16 bits, signals with pulse duty cycles from
0.0015% to 99.9985% can be measured. The software work is less than half that
needed with a timer that requires the software to read one edge and save the value,
and then wait for the second edge.
Figure 13-16 CTM9 Example — Double Capture Pulse Width Measurement
13.11.3 CTM9 Input Double Edge Period Measurement
Two samples are also available to the software from a double-action submodule for
period measurement. The software can read the previous and the current edge sam-
ples and subtract them. As with pulse width measurement, the software can be sure
16-Bit Up Counter
Submodule Bus
Clock
Select
16-Bit Register B1
Edge
Detect
Input
Pin
16-Bit Register B2
16-Bit Register A
Input
Capture
Double Action Submodule
Interrupt
on
From
Prescaler
or Pin
Trailing
Bus
Select
Bus
Select
Two
16-Bit
Time-
Base
Buses
Edge
Modulus Counter Submodule
Free-Running or
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.