
CTM
REFERENCE
MOTOROLA
5-1
FREE-RUNNING COUNTER SUBMODULE (FCSM)
For More Information On This Product,
Go to: www.freescale.com
5
5
FREE-RUNNING COUNTER SUBMODULE
(FCSM)
5.1
FCSM description
The free-running counter submodule (FCSM) provides a multipurpose ‘fixed’ time base for use in
a wide range of applications, such as input capture, output compare and PWM signal generation.
The FCSM can also be configured to operate as an event counter; in this case, a flag is set after
a predefined number of events (internal clocks or external events).
A block diagram of the FCSM is shown in Figure 5-1. The main components of the FCSM are a
16-bit loadable free-running up-counter, a clock selector, a time base bus driver and an interrupt
interface.
Note:
In order to be able to count, the FCSM requires the CPSM clock signals to be present.
On coming out of reset, the FCSM 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.
5.2
The FCSM counter
The FCSM counter section comprises a 16-bit register and a 16-bit up-counter. Reading the
register transfers the contents of the counter to the data bus, while a write to the register loads the
counter with the new value. Overflow of the counter is defined to be the transition from $FFFF to
$0000. An overflow condition causes the COF flag bit in the FCSMSIC register to be set.
Note:
Reset presets the counter register to $0000. Writing $0000 to the counter register while
the counter’s value is $FFFF does not set the COF flag and does not generate an
interrupt request.
F
.
Freescale Semiconductor, Inc.