Enhanced Modular I/O Subsystem (eMIOS200)
MPC5510 Microcontroller Family Reference Manual, Rev. 1
26-26
Freescale Semiconductor
Preliminary
MODE[6] bit selects the internal clock source if set to zero or external, if set to one. When the external
clock is selected the input channel pin is used as the channel clock source. The active edge of this clock is
defined by EDPOL and EDSEL bits in the EMIOS_CCR channel register.
When entering in MCB mode, if the up counter is selected by MODE[4]=0, the internal counter starts
counting from its current value to up direction until A1 match occurs. On the next system clock cycle after
the A1 match occurs, the internal counter is set to one. If up/down counter is selected by setting
MODE[4]=1, the counter changes direction at the A1 match and counts down until it reaches the value
one. After it has reached one, it is set to count in up direction again. Register B1 is set to one at mode
entering and cannot be changed while this mode is selected. B1 register is used to generate a match to set
the internal counter in up-count direction if up/down mode is selected.
The MCB mode counts between one and A1 register value. Only values greater than 0x1 are allowed to
be written at A1 register. Loading values other than those leads to unpredictable results. The counter cycle
period is equal to A1 value in up counter mode. If in up/down counter mode the period is defined by the
expression: (2*A1)-2.
describes the counter cycle for several A1 values. Register A1 is loaded with A2 register
value at the cycle boundary. Any value written to A2 register within cycle (n) will be updated to A1 at the
next cycle boundary and therefore will be used on cycle (n+1). The cycle boundary between cycle (n) and
cycle (n+1) is defined as the first system clock cycle of cycle (n+1). The flags are generated as soon as A1
match had occurred.
Figure 26-22. Modulus Counter Buffered (MCB) Up Count Mode
describes the MCB in up/down counter mode. A1 register is updated at the cycle boundary.
If A2 is written in cycle (n), this new value will be used in cycle (n+1) for A1 match.
Flags are generated at A1 match only if MODE[5] is 0. If MODE[5] is set to 1 flags are also generated at
the cycle boundary.
EMIOS_CCNTR[n]
Time
Write to A2
Match A1
Match A1
Match A1
Write to A2
0x000001
0x000005
0x000006
0x000007
FLAG Set Event
0x000005
0x000007
A2 Value
A1 Value
0x000006
0x000005
0x000007
0x000007