FTM counter
0
0
0
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
4
4
FTM counting is up-down
TOF bit
set TOF bit
set TOF bit
MODH:L = 0x0004
period of FTM counter clock
period of counting = 2 x MODH:L x period of FTM counter clock
Figure 12-5. Example of up-down counting
12.4.3.3 Free running counter
If (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
0x0004
0x0004
0xFFFE 0xFFFF
0x0003
0x0000 0x0001 0x0002 0x0003
0x0005 0x0006
TOF bit
...
...
...
set TOF bit
MODH:L = 0x0000
Figure 12-6. Example when the FTM counter is a free running
12.4.3.4 Counter reset
Any write to CNTH or CNTL register resets the FTM counter to the value of 0x0000 and
the channels output to its initial value, except for channels in output compare mode.
12.4.4 Input capture mode
The input capture mode is selected when (CPWMS = 0), (MSnB:MSnA = 0:0), and
(ELSnB:ELSnA ≠ 0:0).
Functional Description
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
248
NXP Semiconductors
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 ...