
MOTOROLA
6-2
CTM
REFERENCE
MODULUS COUNTER SUBMODULE (MCSM)
For More Information On This Product,
Go to: www.freescale.com
6
The main components of the MCSM are a 16-bit modulus latch, a 16-bit loadable up-counter,
counter loading logic, a clock selector, a time base bus driver and an interrupt interface.
Note:
In order to be able to count, the MCSM requires the CPSM clock signals to be present.
On coming out of reset, the MCSM will not count internal or external events until the
prescaler in the CPSM starts running (when the software sets the PRUN bit). This
allows all counters in the CTM submodules to be synchronized.
6.2
The MCSM modulus latch
The 16-bit modulus latch is a read/write register that is used to reload the counter automatically
with a predetermined value. The contents of the modulus latch register can be read at any time.
Writing to the register loads the modulus latch with the new value. This value is then transferred to
the counter register on the next hardware load of that counter. However, writing to the
corresponding counter register loads the modulus latch and the counter register immediately with
the new value. The modulus latch register is cleared to $0000 by reset.
6.3
The MCSM counter
The counter is composed of a 16-bit read/write register associated with a 16-bit incrementer.
Reading the counter transfers the contents of the counter register to the data bus; writing to the
counter loads the modulus latch and the counter register immediately with the new value. The
counter can be clocked with different clock sources (see Section 6.4).
Note:
Reset presets the counter register to $0000. Writing $0000 to the counter register while
its value is $FFFF does not set the COF flag and does not generate an interrupt.
6.3.1
Loading the MCSM counter register
The counter register can be loaded by writing directly to it.
The counter register is also loaded from the modulus latch each time a counter overflow occurs
and the COF flag bit in the MCSM status/interrupt/control register (MCSMSIC) is set.
Note:
When the modulus latch is loaded with $FFFF, the overflow flag is set on every counter
clock pulse.
F
.
Freescale Semiconductor, Inc.