English
Language : 

K60P100M100SF2RM Datasheet, PDF (989/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
FTM counting is up
MOD = 0x0005
CNTIN = 0x0015
Chapter 39 FlexTimer (FTM)
load of CNTIN
load of CNTIN
FTM counter 0x0005 0x0015 0x0016 ... 0xFFFE 0xFFFF 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0015 0x0016 ...
TOF bit
set TOF bit
set TOF bit
Figure 39-170. Example of Up Counting When the Value of CNTIN Is Greater Than the
Value of MOD
39.4.3.2 Up-Down Counting
Up-down counting is selected when (QUADEN= 0) and (CPWMS = 1).
CNTIN defines the starting value of the count and MOD defines the final value of the
count. The value of CNTIN is loaded into the FTM counter, and the counter increments
until the value of MOD is reached, at which point the counter is decremented until it
returns to the value of CNTIN and the up-down counting restarts.
The FTM period when using up-down counting is 2 × (MOD – CNTIN) × period of the
FTM counter clock.
The TOF bit is set when the FTM counter changes from MOD to (MOD – 1).
If (CNTIN = 0x0000), the FTM counting is equivalent to TPM up-down counting (that is,
up-down and unsigned counting) (see the following figure).
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
Freescale Semiconductor, Inc.
989