
MOTOROLA
5-2
CTM
REFERENCE
FREE-RUNNING COUNTER SUBMODULE (FCSM)
For More Information On This Product,
Go to: www.freescale.com
5
5.3
FCSM clock sources
The user can choose from eight software selectable counter clock sources:
–
–
–
six prescaler outputs (PCLKx)
input pin rising edge detection on the input pin CTMC
input pin falling edge detection on the input pin CTMC
The clock source is selected by the CLK[2:0] bits in the FCSM status, interrupt and control register
FCSMSIC (see Section 5.7.1). When the CLK[2:0] bits are being changed, internal circuitry
ensures that spurious edges occurring on the CTMC pin do not affect the FCSM.
Note that the read-only IN bit of the FCSMSIC register reflects the state of the input pin CTMC.
The input pin is Schmitt triggered and is synchronized with the system clock (f
SYS
).
5.3.1
FCSM external event counting
When an external clock source (on the input pin) is selected, the FCSM is in the event counter
mode. The counter can simply count the number of events occurring on the input pin. Alternatively,
the FCSM can be programmed to generate an interrupt when a predefined number of events have
been counted; this is done by presetting the counter with the two’s complement value of the
Figure 5-1
FCSM block diagram
16-bit up counter
IL2
IL1
IL0
IARB3
COF
Edge
detect
Time base buses
Input pin
CTMC
Interrupt
control
Clock
select
IN
CLK1 CLK0
CLK2
Overflow
Bus
select
Control register bits
Control register bits
DRVA DRVB
Control register bits
6 clocks (PCLKx) fromprescaler
Submodule bus
TBBA
TBBB
F
.
Freescale Semiconductor, Inc.