17-30
MPC561/MPC563 Reference Manual
MOTOROLA
MIOS14 Double Action Submodule (MDASM)
17.9.3.1 Disable (DIS) Mode
The disable mode is selected by setting MODE[0:3] to 0b0000.
In this mode, all input capture and output compare functions of the MDASM are disabled
and the FLAG line is maintained inactive, but the input port signal function remains
available. The associated signal becomes a high impedance input and the input level on this
signal is reflected by the state of the PIN bit in the MDASMSCR register. All control bits
remain accessible, allowing the software to prepare for future 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 in order to reset the MDASM’s internal functions
properly. 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
Figure 17-16). 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.