Modular Input/Output Subsystem (MIOS14)
MPC561/MPC563 Reference Manual, Rev. 1.2
Freescale Semiconductor
17-71
samples and subtract them to get the pulse width. The leading edge sample is double latched so that the
software has the time of one full period of the input signal to read the samples to be sure that nothing is
lost. Depending on the prescaler divide ratio, pulse width from 50 ns to 6.7 s can be measured. Note that
a software option is provided to also generate an interrupt after the first edge.
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 leading 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 transferred 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 trailing 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
coherently (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 17-43. MIOS14 Example: Double Capture Pulse Width Measurement
17.13.2 MIOS14 Input Double Edge Period Measurement
Two samples are available to the software from an MIOS14 double action submodule for period
measurement. The software can read the previous and the current edge samples 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 fastest 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 measured from 50 ns to 6.7 s.
16-bit Up-Counter
Submodule Bus
Clock
Select
16-bit Register B1
Edge
Detect
Input
Signal
16-bit Register A
Input
Capture
Interrupt
on
From
Prescaler
or Pin
Trailing
Bus
Select
Edge
Two
16-bit
Counter
Buses
16-bit Register B2
MIOS14 Modulus Counter Submodule
MIOS14 Double Action Submodule
in IPWM mode (MOD3-MOD0 = 0b0001)
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...