Modulo Timer (MTIM)
MCF51CN128 Reference Manual, Rev. 6
Freescale Semiconductor
18-9
18.4.1
MTIM Operation Example
This section shows an example of the MTIM operation as the counter reaches a matching value from the
modulo register.
Figure 18-7. MTIM counter overflow example
In the example of
, the selected clock source could be any of the five possible choices. The
prescaler is set to PS = %0010 or divide-by-4. The modulo value in the MTIMMOD register is set to
0xAA. When the counter, MTIMCNT, reaches the modulo value of 0xAA, the counter overflows to 0x00
and continues counting. The timer overflow flag, TOF, sets when the counter value changes from 0xAA
to 0x00. An MTIM overflow interrupt is generated when TOF is set, if TOIE = 1.
selected
clock source
MTIMCNT
MTIM clock
(PS=%0010)
MTIMMOD:
0xAA
0xA7
0xA8
0xA9
0xAA
0x00
0x01
TOF