MPC555
/
MPC556
MODULAR INPUT/OUTPUT SUBSYSTEM (MIOS1)
MOTOROLA
USER’S MANUAL
Rev. 15 October 2000
15-39
In the example shown in
, a counter submodule is used as the time-base
for a MDASM configured in the input pulse width measurement mode. When the lead-
ing edge (programmed for being either rising or falling) of the input signal occurs, the
state of the 16-bit counter bus is saved in register B1. When the trailing edge occurs,
the 16-bit counter bus is latched into register A and the content of register B1 is trans-
ferred to register B2. This operation leaves register B1 free for the next leading edge
to occur 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 read registers A and B2 coher-
ently (using a 32-bit read instruction) at any time, to get the latest edge measurements.
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 15-9 MIOS1 Example: Double Capture Pulse Width Measurement
16-bit Up-Counter
Submodule Bus
Clock
Select
16-bit Register B1
Edge
Detect
Input
Pin
16-bit Register A
Input
Capture
Interrupt
on
From
Prescaler
or Pin
Trailing
Bus
Select
Edge
Two
16-bit
Counter
Buses
MIOS Double Action Submodule
in IPWM mode (MOD3-MOD0 = 0b0001)
MIOS Modulus Counter Submodule
16-bit Register B2
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
.
..