Enhanced Modular Input/Output Subsystem (eMIOS200)
23-26
Freescale Semiconductor
PXR40 Microcontroller Reference Manual, Rev. 1
23.4.1.1.4
Input Pulse-Width Measurement (IPWM) Mode
The IPWM mode (MODE = 000_0100) allows measuring the width of a positive or negative pulse by
capturing the leading edge on register B1 and the trailing edge on register A2. Successive captures are done
on consecutive edges of opposite polarity. The leading edge sensitivity (i.e., pulse polarity) is selected by
the EDPOL bit in the EMIOS_CCR[
n
] register. Registers EMIOS_CADR[
n
] and EMIOS_CBDR[
n
]
return the values in register A2 and B1, respectively.
The capture function of register A2 remains disabled until the first leading edge triggers the first input
capture on register B2. When this leading edge is detected, the count value of the selected time base is
latched into register B2; the FLAG bit is not set. When the trailing edge is detected, the count value of the
selected time base is latched into register A2. At the same time, the FLAG bit is set and the content of
register B2 is transferred to register B1 and to register A1.
If subsequent input capture events occur while the corresponding FLAG bit is set, registers A2, B1, and
A1 are updated with the latest captured values and the FLAG remains set. Registers EMIOS_CADR[
n
]
and EMIOS_CBDR[
n
] return the value in registers A2 and B1, respectively.
In order to guarantee coherent access, reading EMIOS_CADR[
n
] forces B1 to be updated with the content
of register A1. At the same time, transfers between B2 and B1 are disabled until the next read of
EMIOS_CBDR[
n
] register. Reading EMIOS_CBDR[
n
] register forces B1 be updated with A1 register
content and re-enables transfers from B2 to B1, to take effect at the next trailing edge capture. Transfers
from B2 to A1 are not blocked at any time.
The input pulse width is calculated by subtracting the value in B1 from A2.
shows how the unified channel can be used for input pulse-width measurement.
Figure 23-18. IPWM Example
shows the A1 and B1 updates when EMIOS_CADR[
n
] and EMIOS_CBDR[
n
] register reads
occur. The A1 register has always coherent data related to the A2 register. When a EMIOS_CADR[
n
] read
is performed, the B1 register is loaded with the A1 register content. This guarantees that the data in register
B1 always has the coherent data related to the last EMIOS_CADR[
n
] read. The B1 register updates remain
0x000500
0x001000
0x001100
0x001250
0x001525
0x0016A0
Selected
Counter Bus
FLAG Set Event
B
B
B
A2 (Captured) Value
2
0xxxxxxx
Notes:
1. After input filter
2. EMIOS_CADR[n] = A2
Input Signal
1
EDPOL = 1
A
A
B1 Value
3
0x001525
0x001100
0xxxxxxx
0x001250
0x001000
0xxxxxxx
0x001000
0x001250
0x0016A0
B2 (Captured) Value
3. EMIOS_CBDR[n] = B1
0xxxxxxx
0x001250
0x001000
A1 Value
3
Summary of Contents for PXR4030
Page 1: ...PXR40 Microcontroller Reference Manual Devices Supported PXR4030 PXR4040 PXR40RM Rev 1 06 2011...
Page 30: ...PXR40 Microcontroller Reference Manual Rev 1 Freescale Semiconductor xxx...
Page 40: ...PXR40 Microcontroller Reference Manual Rev 1 xl Freescale Semiconductor...
Page 66: ...Memory Map PXR40 Microcontroller Reference Manual Rev 1 2 4 Freescale Semiconductor...
Page 120: ...Signal Descriptions 3 54 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...
Page 860: ...FlexCAN Module 24 50 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...
Page 1167: ...Decimation Filter Freescale Semiconductor 28 53 PXR40 Microcontroller Reference Manual Rev 1...
Page 1168: ...Decimation Filter 28 54 Freescale Semiconductor PXR40 Microcontroller Reference Manual Rev 1...