Modular Input/Output Subsystem (MIOS14)
MPC561/MPC563 Reference Manual, Rev. 1.2
Freescale Semiconductor
17-31
Figure 17-16. Input Pulse Width Measurement Example
17.9.3.3
Input Period Measurement (IPM) Mode
IPM mode is selected by setting MODE[0:3] to 0b0010.
This mode allows the period of an input signal to be determined 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 sensitivity is defined 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 (refer to
). When the first edge having the selected
polarity is detected, the 16-bit counter bus value is latched into the 16-bit data register A. Data in register
B1 is transferred to data register B2 and the data in register A is transferred to register B1.
On this first capture the FLAG line is not activated, and the value in register B2 is meaningless. On the
second and subsequent captures, the FLAG line is activated when the data in register A is transferred to
register B1.
When the second edge of the same polarity is detected, the counter bus value is latched into data register
A, the data in register B1 is transferred to data register B2, the FLAG line is activated to signify that the
beginning and end points of a complete period have been captured, and finally the data in register A is
transferred to register B1. This sequence of events is repeated for each subsequent capture. Reading data
register B returns the value in register B2.
FLAG reset
by software
Mode selection; EDPOL = 1 (Channel A capture on falling edge, Channel B capture on rising edge)
Input
Counter
FLAG bit
0xxxxx
0xxxxx
0x1000
Register B1
Register B2
0x1000
0x1000
0x1100
0x1100
0x1400
0x1000
0x1400
0x1525
0x1400
0x1525
0x1400
0x16A0
Edge Trigger
Register A
0xxxxx
0xxxxx
Edge Trigger
Rising
Falling
Edge Trigger
Edge Trigger
Rising
Falling
Edge Trigger
Rising
Flag set
Flag set
B1 is an internal register, not accessible to software
FLAG reset
by software
Pulse 1
Pulse 2
Pulse 1 = Reg A- Reg B
= 0x0100
Pulse 2 = Reg A- Reg B
= 0x0125
16-bit
Bus
signal
2
3
1
1
2
3
0x0500
0x1400
0x1525
0x16A0
0xxxxx
0x1000
0x1100
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...