Functional Description
13.6.1 MTIM16 Operation Example
This section shows an example of the MTIM16 module's operation as the counter reaches
a matching value from the modulo register.
selected
clock source
MTIM16 clock
(PS=%0010)
MTIMCNT
0x01A7
TOF
MTIMMOD:
In this figure, the selected clock source could be any of the four possible choices. The
prescaler is set to divide-by-4 (the PS field is 0010). The modulo value in the
MODH:MODL register is set to 01AAh. When the counter (CNTH:CNTL registers)
reaches the modulo value of 01AAh, the counter overflows to 0000h and continues
counting. The timer overflow flag, TOF, sets when the counter value changes from
01AAh to 0000h. An MTIM16 overflow interrupt is generated when TOF is set, if the
TOIE bit is 1.
216
0x01A8
Figure 13-2. MTIM16 Counter Overflow Example
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
0x01A9
0x01AA
0x01AA
0x0001
0x0000
NXP Semiconductors