Modular Input/Output Subsystem (MIOS14)
MPC561/MPC563 Reference Manual, Rev. 1.2
17-30
Freescale Semiconductor
mode selection. Data registers A and B are accessible at consecutive addresses. Writing to data register B
stores the same value in registers B1 and B2.
WARNING
When changing modes, it is imperative to go through the DIS mode. Failure
to do this could lead to invalid and unexpected output compare or input
capture results, and to flags being set incorrectly.
17.9.3.2
Input Pulse Width Measurement (IPWM) Mode
IPWM mode is selected by setting MODE[0:3] to 0b0001.
This mode allows the width of a positive or negative pulse to be determined by capturing the leading edge
of the pulse on channel B and the trailing edge of the pulse on channel A; successive captures are done on
consecutive edges of opposite polarity. The edge sensitivity is selected by the EDPOL bit in the
MDASMSCR register.
This mode also allows the software to determine the logic level on the input signal at any time by reading
the PIN bit in the MDASMSCR register.
The channel A input capture function remains disabled until the first leading edge triggers the first input
capture on channel B (refer to
). When this leading edge is detected, the count value of the
16-bit counter bus selected by the BSL[1:0] bits is latched in the 16-bit data register B1; the FLAG line is
not activated. When the next trailing edge is detected, the count value of the 16-bit counter bus is latched
into the 16-bit data register A and, at the same time, the FLAG line is activated and the contents of register
B1 are transferred to register B2.
Reading data register B returns the value in register B2. If subsequent input capture events occur while the
FLAG bit is set in the corresponding MIRSM, data registers A and B will be updated with the latest
captured values and the FLAG line will remain active.
If a 32-bit coherent operation is in progress when the trailing edge is detected, the transfer from B1 to B2
is deferred until the coherent operation is completed. Operation of the MDASM then continues on
channels B and A as previously described.
The input pulse width is calculated by subtracting the value in data register B from the value in data register
A.
provides an example of how the MDASM can be used for input pulse width measurement.
Summary of Contents for MPC561
Page 84: ...MPC561 MPC563 Reference Manual Rev 1 2 lxxxiv Freescale Semiconductor...
Page 144: ...Signal Descriptions MPC561 MPC563 Reference Manual Rev 1 2 2 46 Freescale Semiconductor...
Page 206: ...Central Processing Unit MPC561 MPC563 Reference Manual Rev 1 2 3 62 Freescale Semiconductor...
Page 302: ...Reset MPC561 MPC563 Reference Manual Rev 1 2 7 14 Freescale Semiconductor...
Page 854: ...Time Processor Unit 3 MPC561 MPC563 Reference Manual Rev 1 2 19 24 Freescale Semiconductor...
Page 968: ...Development Support MPC561 MPC563 Reference Manual Rev 1 2 23 54 Freescale Semiconductor...
Page 1144: ...Internal Memory Map MPC561 MPC563 Reference Manual Rev 1 2 B 34 Freescale Semiconductor...
Page 1212: ...TPU3 ROM Functions MPC561 MPC563 Reference Manual Rev 1 2 D 60 Freescale Semiconductor...
Page 1216: ...Memory Access Timing MPC561 MPC563 Reference Manual Rev 1 2 E 4 Freescale Semiconductor...