Datasheet

FTM counter
0 0 0
1 1 11 1
2 2 22 23 3 33 34 4 4
FTM counting is up-down
TOF bit
set TOF bit set TOF bit
CNTINH:L = 0x0000
MODH:L = 0x0004
period of FTM counter clock
period of counting = 2 x (MODH:L - CNTINH:L) x period of FTM counter clock
= 2 x MODH:L x period of FTM counter clock
Figure 12-191. Example of up-down counting when CNTIN = 0x0000
Note
The up-down counting is available only when (CNTINH:L
= 0x0000).
The configuration with (CNTINH:L ≠ 0x0000) when
(CPWMS = 1) is not recommended and its results are not
guaranteed.
12.4.3.3 Free running counter
If (FTMEN = 0) and (MODH:L = 0x0000 or MODH:L = 0xFFFF), the FTM counter is a
free running counter. In this case, the FTM counter runs free from 0x0000 through
0xFFFF and the TOF bit is set when the FTM counter changes from 0xFFFF to 0x0000
See the following figure.
FTM counter
0x00040x0004
0xFFFE
0xFFFF
0x0003
0x0000
0x0001
0x0002 0x0003 0x0005 0x0006
TOF bit
... ... ...
FTMEN = 0
set TOF bit
MODH:L = 0x0000
Figure 12-192. Example when the FTM counter is a free running
The FTM counter is also a free running counter when all of the following apply:
(FTMEN = 1)
Chapter 12 FlexTimer Module (FTM)
MC9S08PA60 Reference Manual, Rev. 1, 9/2012
Freescale Semiconductor, Inc. 329