MPC555
/
MPC556
MODULAR INPUT/OUTPUT SUBSYSTEM (MIOS1)
MOTOROLA
USER’S MANUAL
Rev. 15 October 2000
15-40
15.15.2 MIOS1 Input Double Edge Period Measurement
Two samples are available to the software from an MIOS 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
not to miss samples by ensuring that the interrupt response time is faster than the fast-
est input period. Alternately, when the software is just interested in the latest period
measurement, one 32-bit coherent read instruction can get both the current and the
previous samples. Depending on the prescaler divide ratio, period times can be mea-
sured from 50 ns to 6.7 s.
shows a counter submodule and a DASM combination as an example
of period measurement. The software designates whether the rising or falling edge of
the input signal is to be used for the measurements. When the edge is detected, the
state of the 16-bit counter bus is stored in register A and the content of register B1 is
transferred to register B2. After register B2 is safely latched, the content of register A
is transferred to register B1. This procedure gives the software coherent current and
previous samples in registers A and B2 at all times. An interrupt is available for the cas-
es where the software needs to be aware of each new sample. Note that a software
option is provided to also generate an interrupt after the first edge.
Figure 15-10 MIOS1 Example: Double Capture Period Measurement
16-bit Up-Counter
Submodule Bus
Clock
Select
16-bit Register B1
Edge
Detect
Input
Pin
16-bit Register B2
Input
Capture
Interrupt
on
From
Prescaler
or Pin
Designated
Bus
Select
Edge
16-bit Register A
Two
16-bit
Counter
Buses
MIOS Double Action Submodule
in IPM mode (MOD3-MOD0 = 0b0010)
MIOS Modulus Counter Submodule
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
.
..