Enhanced Modular Input/Output Subsystem (eMIOS200)
Freescale Semiconductor
23-33
PXR40 Microcontroller Reference Manual, Rev. 1
Figure 23-26. PEA Single-Shot Mode Example
23.4.1.1.8
Pulse/Edge Counting (PEC) Mode
The PEC mode returns the amount of pulses or edges detected on the input for a desired time window. The
MODE[6] bit selects between continuous or single-shot operation.
Triggering of the internal counter is done by a rising or falling edge or both edges on the input signal. The
polarity and the triggering edge is selected by EDSEL and EDPOL bits in the EMIOS_CCR[
n
] register.
Register A1 holds the start time and register B1 holds the stop time for the time window. After writing to
register A1, when a match occur between comparator A and the selected timebase, the internal counter is
cleared and it is ready to start counting input events. When the time base matches comparator B, the
internal counter is disabled and its content is transferred to register A2. At the same time the FLAG bit is
set. Reading registers EMIOS_CCNTR[
n
] or A2 returns the amount of detected pulses.
For continuous operation (MODE[6] cleared, MODE[0:6] = 000_1010), the next match between
comparator A and the selected time base clears the internal counter and counting is enabled again. In order
to guarantee coherent measurements when reading EMIOS_CCNTR[
n
] after the FLAG is set, the software
must check if the time base value is out of the time interval defined by registers A1 and B1. Alternatively
register A2 always holds the latest available measurement providing coherent data at any time after the
first FLAG had occurred. This register is addressed by the alternate address EMIOS_ALTA[
n
].
For single-shot operation (MODE[6] set, MODE[0:6] = 000_1011), the next match between comparator
A and the selected time base has no effect, until a new write to register A (EMIOS_CADR) is performed.
The EMIOS_CCNTR content is also transferred to register A2 when a match in the B comparator occurs.
show how the unified channel can be used for continuous or single-shot
pulse/edge counting mode.
0xFFFFFF
0x000000
EMIOS_CCNTR[n]
1
Time
Selected Counter Bus
0x000400
A1 Value
3
0x001500
0xxxxxxx
A2 Value
4
0x000400
0xxxxxxx
B1 Value
0x000090
0xxxxxxx
B2 Value
5
0xxxxxxx
0x001500
0x000090
0x000090
FLAG Pin/Register
0x001500
Input Signal
2
A1 Events
Notes:
4. EMIOS_CADR[n] = A2 (when reading)
5. EMIOS_CBDR[n] = B1
3. EMIOS_CADR[n] = A1 (when writing)
2. After input filter
Events
Events
0x000400
1. Cleared on the first input event after writing to register A1
MODE[6] = 1
A1 Match
Write to A1
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...