![NXP Semiconductors MC9S08PA4 Reference Manual Download Page 247](http://html1.mh-extra.com/html/nxp-semiconductors/mc9s08pa4/mc9s08pa4_reference-manual_1721838247.webp)
MODH:L = 0x0004
FTM counting is up (CPWMS = 0)
TOF bit
3
4
0
0
1
1
2
2
3
3
4
4
0
1
2
FTM counter
set TOF bit
period of FTM counter clock
period of counting = (MODH:L + 0x0001) x period of FTM counter clock
set TOF bit
set TOF bit
Figure 12-4. Example of FTM up counting
12.4.3.2 Up-down counting
Up-down counting is selected when (CPWMS = 1).
The starting value of the count is 0x0000 and MODH:L defines the final value of the
count. The value of 0x0000 is loaded into the FTM counter, and the counter increments
until the value of MODH:L is reached, at which point the counter is decremented until it
returns to the value of 0x0000 and the up-down counting restarts.
The FTM period when using up-down counting is 2 × (MODH:L) × period of the FTM
counter clock.
The TOF bit is set when the FTM counter changes from MODH:L to (MODH:L – 1).
Chapter 12 FlexTimer Module (FTM)
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
NXP Semiconductors
247
Summary of Contents for MC9S08PA4
Page 1: ...MC9S08PA4 Reference Manual Supports MC9S08PA4 Document Number MC9S08PA4RM Rev 5 08 2017 ...
Page 2: ...MC9S08PA4 Reference Manual Rev 5 08 2017 2 NXP Semiconductors ...
Page 22: ...MC9S08PA4 Reference Manual Rev 5 08 2017 22 NXP Semiconductors ...
Page 28: ...System clock distribution MC9S08PA4 Reference Manual Rev 5 08 2017 28 NXP Semiconductors ...
Page 150: ...Port data registers MC9S08PA4 Reference Manual Rev 5 08 2017 150 NXP Semiconductors ...
Page 196: ...Human machine interfaces HMI MC9S08PA4 Reference Manual Rev 5 08 2017 196 NXP Semiconductors ...
Page 224: ...Instruction Set Summary MC9S08PA4 Reference Manual Rev 5 08 2017 224 NXP Semiconductors ...
Page 232: ...Functional Description MC9S08PA4 Reference Manual Rev 5 08 2017 232 NXP Semiconductors ...
Page 258: ...FTM Interrupts MC9S08PA4 Reference Manual Rev 5 08 2017 258 NXP Semiconductors ...
Page 294: ...Functional description MC9S08PA4 Reference Manual Rev 5 08 2017 294 NXP Semiconductors ...
Page 398: ...Resets MC9S08PA4 Reference Manual Rev 5 08 2017 398 NXP Semiconductors ...
Page 400: ...MC9S08PA4 Reference Manual Rev 5 08 2017 400 NXP Semiconductors ...