12.4.2 Prescaler
The selected counter clock source passes through a prescaler that is a 7-bit counter. The
value of the prescaler is selected by the PS[2:0] bits. The following figure shows an
example of the prescaler counter and FTM counter.
FTM counter
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
2
2
3
3
1
1
1
1
1
1
1
1
1
EPWM
selected input clock
prescaler counter
PS[2:0] = 001
MODH:L = 0x0003
Figure 12-3. Example of the prescaler counter
12.4.3 Counter
The FTM has a 16-bit counter that is used by the channels either for input or output
modes. The FTM counter clock is the selected clock divided by the prescaler (see
The FTM counter has these modes of operation:
)
• up-down counting (see
12.4.3.1 Up counting
Up counting is selected when (CPWMS = 0).
The starting value of the count is 0x0000 and MODH:L defines the final value of the
count; see the following figure. 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 reloaded with 0x0000.
The FTM period when using up counting is (MODH:L + 0x0001) × period of the FTM
counter clock.
The TOF bit is set when the FTM counter changes from MODH:L to 0x0000.
Functional Description
MC9S08PA4 Reference Manual, Rev. 5, 08/2017
246
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 ...