MPC563XM Reference Manual, Rev. 1
664
Freescale Semiconductor
Preliminary—Subject to Change Without Notice
Figure 22-31. B1 and A1 updates at EMIOSA[n] and EMIOSB[n] reads
Reading EMIOSA[n] followed by EMIOSB[n] always provide coherent data. If not coherent data is
required for any reason, the sequence of reads should be inverted, therefore EMIOSB[n] should be read
prior to EMIOSA[n] register. Note that even in this case B1 register updates will be blocked after
EMIOSA[n] read, thus a second EMIOSB[n] is required in order to release B1 register updates.
22.5.1.1.5
Input Period Measurement (IPM) Mode
The IPM mode (MODE[0:6]=0000101) allows the measurement of the period of an input signal by
capturing two consecutive rising edges or two consecutive falling edges. Successive input captures are
done on consecutive edges of the same polarity. The edge polarity is defined by the EDPOL bit in the
EMIOSC[n] register.
When the first edge of selected polarity is detected, the selected time base is latched into the registers A2
and B2, and the data previously held in register B2 is transferred to register B1. On this first capture the
FLAG line is not set, and the values in registers B1 is meaningless. On the second and subsequent captures,
the FLAG line is set and data in register B2 is transferred to register B1.
When the second edge of the same polarity is detected, the counter bus value is latched into registers A2
and B2, the data previously held in register B2 is transferred to data register B1 and to register A1. The
FLAG bit is set to indicate the start and end points of a complete period have been captured. This sequence
of events is repeated for each subsequent capture. Registers EMIOSA[n] and EMIOSB[n] return the values
in register A2 and B1, respectively.
In order to allow coherent data, reading EMIOSA[n] forces A1 content be transferred to B1 register and
disables transfers between B2 and B1. These transfers are disabled until the next read of the EMIOSB[n]
register. Reading EMIOSB[n] register forces A1 content to be transferred to B1 and re-enables transfers
from B2 to B1, to take effect at the next edge capture.
The input pulse period is calculated by subtracting the value in B1 from A2.
shows how the Unified Channel can be used for input period measurement.
selected counter bus
$000500
$001000
$001100
$001250
$001525
$0016A0
A2(captured) value
2
B2(captured) value
B1 value
3
$xxxxxx
$001000
$001250
$0016A0
$xxxxxx
$001100
$001525
$xxxxxx
$001000
Input signal
1
B
A
B
A
B
1. After input filter
Notes:
FLAG pin/register
2. EMIOSA[n] = A2
EDPOL = 1
A1 value
3
$xxxxxx
$001000
$001250
$001000
$001250
Read EMIOSA[n]
Read EMIOSB[n]
3. EMIOSB[n] = B1