English
Language : 

MC9S08SH8CTG Datasheet, PDF (269/341 Pages) Freescale Semiconductor, Inc – HCS08 Microcontrollers
Chapter 16 Timer/PWM Module (S08TPMV3)
EPWM mode
TPMxMODH:TPMxMODL = 0x0007
TPMxCnVH:TPMxCnVL = 0x0005
RESET (active low)
BUS CLOCK
TPMxCNTH:TPMxCNTL
0
1 2 3 4 5 6 7 0 1 2 ...
CLKSB:CLKSA BITS
00
MSnB:MSnA BITS
00
ELSnB:ELSnA BITS
00
TPMv2 TPMxCHn
01
10
01
TPMv3 TPMxCHn
CHnF BIT
(in TPMv2 and TPMv3)
Figure 0-2. Generation of low-true EPWM signal by TPM v2 and v3 after the reset
The following procedure can be used in TPM v3 (when the channel pin is also a port pin) to emulate
the high-true EPWM generated by TPM v2 after the reset.
...
configure the channel pin as output port pin and set the output pin;
configure the channel to generate the EPWM signal but keep ELSnB:ELSnA as 00;
configure the other registers (TPMxMODH, TPMxMODL, TPMxCnVH, TPMxCnVL, ...);
configure CLKSB:CLKSA bits (TPM v3 starts to generate the high-true EPWM signal, however
TPM does not control the channel pin, so the EPWM signal is not available);
wait until the TOF is set (or use the TOF interrupt);
enable the channel output by configuring ELSnB:ELSnA bits (now EPWM signal is available);
...
MC9S08SH8 MCU Series Data Sheet, Rev. 3
Freescale Semiconductor
265