
MOTOROLA
1-6
CTM
REFERENCE
FUNCTIONAL OVERVIEW
For More Information On This Product,
Go to: www.freescale.com
1
Depending on software options, counter and action submodules located in the left half of
Figure 1-1 (submodules M to N) can be connected to buses TBB1 or TBB2, while counter and
action submodules located in the right half of Figure 1-1 (submodules 1 to M-1) can be connected
to buses TBB3 and TBB4.
1.5
Pin descriptions
Input/output requirements are specific to each CTM submodule; pin allocation and functionality is
described in the relevant sections of this document.
1.6
Input capture (IC) concepts
A typical 16-bit input capture function is shown in Figure 1-5. It has three basic parts: edge select
logic, a 16-bit input capture latch and a 16-bit free-running counter. The edge select logic
determines the input signal transition (rising or falling) that triggers the input capture circuitry.
When the selected transition occurs, the contents of the counter are latched into the input capture
latch. This action sets a status flag indicating that an input capture has occurred. An interrupt is
generated if enabled. The value of the count latched or ‘captured’ is the time of the event. Because
this value is stored in the input capture register when the actual event occurs, user software can
respond to this event at a later time and determine the actual time of the event. However, this must
be done prior to another input capture on the same pin; otherwise, the previous time value will be
lost.
By recording the times for successive edges on an incoming signal, software can determine the
period and/or pulse width of the signal. To measure a period, two successive edges of the same
polarity are captured. To measure a pulse width, consecutive edges of opposing polarity are
captured. For example, to measure the high time of a pulse, the input transition time is captured
on the rising edge and subtracted from the time captured on the subsequent falling edge. When
the period or pulse width is less than a full 16-bit counter overflow period, the measurement is very
straightforward. In practice, however, software usually must keep track of the number of overflows
of the 16-bit counter in order to extend the range.
Another typical use of the input capture function is to establish a time reference. In this case it may
be used in conjunction with an output compare function in the same timer. For example, consider
the case where it is required to generate an output signal transition a specific number of clock
cycles after detecting an event (edge). The input capture function can be used to record the time
at which the event occurred. A number corresponding to the desired delay can then be added to
this captured value and stored in an output compare register. Because input capture and output
compare functions are referenced to the same 16-bit counter, the delay can be controlled to the
resolution of the free-running counter, independent of software latencies.
F
.
Freescale Semiconductor, Inc.