MPC563XM Reference Manual, Rev. 1
674
Freescale Semiconductor
Preliminary—Subject to Change Without Notice
next prescaler tick after the match the internal counter remains at zero and only resumes
counting on the following tick. See
•
Internal counter clearing on match end (MODE[0:6]=001001b)
— External clock is selected if MODE[6] is set. In this case the internal counter clears when the
match signal is asserted and the input event occurs. The channel FLAG is set at the same time
the counter is cleared. See
— Internal clock source is selected if MODE[6] is cleared. In this case the internal counter clears
when the match signal is asserted and the prescaler tick occurs. The channel FLAG is set at the
same time the counter is cleared. See
NOTE
If internal clock source is selected and the prescaler of the internal counter
is set to 1 the MC mode behaves the same way even in Clear on Match Start
or Clear on Match End sub-modes.
When in up/down count mode (MODE[0:6]=00101bb), a match between the internal counter and register
A1 sets the FLAG and changes the counter direction from increment to decrement. A match between
register B1 and the internal counter changes the counter direction from decrement to increment and sets
the FLAG only if MODE[5] bit is set.
Only values different than $0 must be written at A register. Loading $0 leads to unpredictable results.
Updates on A register or counter in MC mode may cause loss of match in the current cycle if the transfer
occurs near the match. In this case, the counter may rollover and resume operation in the next cycle.
Register B2 has no effect in MC mode. Nevertheless, register B2 can be accessed for reads and writes by
addressing EMIOSB.
show how the Unified Channel can be used as modulus counter in up mode
and up/down mode, respectively.
Figure 22-44. Modulus Counter up mode example
$FFFFFF
$000303
$000000
EMIOSCNT[n]
Time
Match A1
A1 value
1
$000303
$000303
$000200
write to A2
Match A1
write to A2
$000200
Match A1
Match A1
$xxxxxx
FLAG pin/register
Notes: 1. EMIOSA[n] = A1
$000303
$000200
A2 = A1according to OU[n] bit
MODE
[4]
= 0