MC68HC16R1/916R1
USER’S MANUAL
CONFIGURABLE TIMER MODULE 7
MOTOROLA
12-7
12.6.3 FCSM External Event Counting
When an external clock source is selected, the FCSM can act as an event counter
simply by counting the number of events occurring on the CTM2C input pin. Alterna-
tively, the FCSM can be programmed to generate an interrupt request when a pre-
defined number of events have been counted. This is done by presetting the counter
with the two’s complement value of the desired number of events.
12.6.4 FCSM Time Base Bus Driver
The DRVA and DRVB bits in FCSMSIC select the time base bus to be driven. Which
of the time base buses is driven depends on where the FCSM is physically placed in
any particular CTM implementation. Refer to
Figure 12-1
and
Table 12-1
for more
information.
WARNING
Two time base buses should not be driven at the same time.
12.6.5 FCSM Interrupts
The FCSM can optionally request an interrupt when its counter overflows and the COF
bit in FCSMSIC is set. To enable interrupts, set the IL[2:0] field in the FCSMSIC to a
non-zero value. The CTM7 compares the CPU16 IP mask value to the priority of the
requested interrupt designated by IL[2:0] to determine whether it should contend for
arbitration priority. During arbitration, the BIUSM provides the arbitration value speci-
fied by IARB[2:0] in BIUMCR and IARB3 in FCSMSIC. If the CTM7 wins arbitration, it
responds with a vector number generated by concatenating VECT[7:6] in BIUMCR
and the six low-order bits specified by the number of the submodule requesting ser-
vice. Thus, for FCSM12 in CTM7, six low-order bits would be 12 in decimal, or
%001100 in binary.
12.6.6 FCSM Registers
The FCSM contains a status/interrupt/control register and a counter register. All un-
used bits and reserved address locations return zero when read. Writes to unused bits
and reserved address locations have no effect. Refer to
D.7.9 FCSM Status/Inter-
rupt/Control Register
and
D.7.10 FCSM Counter Register
for information concern-
ing FCSM register and bit descriptions.
12.7 Modulus Counter Submodule (MCSM)
The modulus counter submodule (MCSM) is an enhanced FCSM. The MCSM con-
tains a 16-bit modulus latch, a 16-bit loadable up-counter, counter loading logic, a
clock selector, selectable time base bus drivers, and an interrupt interface. A modulus
register provides the added flexibility of recycling the counter at a count other than 64K
clock cycles. The content of the modulus latch is transferred to the counter when an
overflow occurs, or when a user-specified edge transition occurs on a designated
modulus load input pin. In addition, a write to the modulus counter simultaneously
loads both the counter and the modulus latch with the specified value. The counter
then begins incrementing from this new value.