Enhanced Modular Input/Output Subsystem (eMIOS200)
Freescale Semiconductor
23-37
PXR40 Microcontroller Reference Manual, Rev. 1
Figure 23-31. WTPA Example
23.4.1.1.11
Modulus Counter (MC) Mode
The MC mode can be used to provide a time base for a counter bus or as a general purpose timer.
The MODE[6] bit selects the internal or external clock source when cleared or set, respectively. When the
external clock is selected, the input signal pin is used as the source and the triggering polarity edge is
selected by the EDPOL and EDSEL bits in the EMIOS_CCR[
n
] register.
The internal counter counts up from the current value until it matches the value in register A1. Register B1
is cleared and is not accessible to the MCU. The MODE[4] bit selects up mode or up/down mode, when
cleared or set, respectively.
When in up count mode, a match between the internal counter and register A1 sets the FLAG and clears
the internal counter. The timing of those events varies according to the MC mode setup as follows:
•
Internal counter clearing on match start (MODE = 001_000b)
— When MODE[6] is set, the external clock is selected. In this case, the internal counter clears as
soon as the match signal occurs. The channel FLAG bit is set at the same time the match occurs.
Note that by having the internal counter cleared as soon as the match occurs and incremented
at the next input event, a shorter zero count is generated. See
— When MODE[6] is cleared, the internal clock source is selected. In this case, the counter clears
as soon as the match signal occurs. The channel FLAG bit is set at the same time the match
occurs. At the next prescaler tick after the match, the internal counter remains at 0 and only
resumes counting on the following tick. See
•
Internal counter clearing on match end (MODE = 001_001b)
0xFFFFFF
0x000000
Time Accumulator
Selected Counter Bus
0x001500
A1 Value
2
0x001500
0x000100
0x000100
Input Signal
1
0x004200
0x003000
B1 Value
3
0x001500
0x004200
0x000100
0x003000
0x004200
FLAG Pin/Register
Notes: 1. After the input filter
EDPOL = 1
2. EMIOS_CADR[n] = A1
3. EMIOS_CBDR[n] = B1
0x003000
A2 Value
4
A2 ¨ EMIOS_CCNTR[n]
4. EMIOS_ALTA[n] = A2
A2 ¨ EMIOS_CCNTR[n]
(EMIOS_CCNTR[n])
A1 & B1
Write
A1 Match
A1 & B1
Write
B1 Match
B1 Match
A1 Match
Time
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...