ST10R272L - PWM MODULE
185/320
10.2
PWM module registers
The PWM module is controlled by two sets of registers. The waveforms are selected by the
timer register PT3, the period register PP3 and the pulse width register PW3. Three
registers control the operating mode and the general functions (PWMCON0 and
PWMCON1) of the PWM module and the interrupt behavior (PWMIC).
10.2.1 Up/down counter PT3
The counter PT3 of the PWM channel 3 is clocked by either the CPU clock or the CPU clock
divided by 64. Bit PTI3 in register PWMCON0 selects the clock source. The PWM counter
counts up or down (controlled by hardware), while its run control bit PTR3 is set. A timer is
started (PTR3 = ‘1’) via software and is stopped (PTR3 = ‘0’) either by hardware or software,
depending on its operating mode. Control bit PTR3 enables or disables the clock input of
counter PT3 rather than controlling the PWM output signal.
PT3 (F036h / 1Bh)
ESFR
Reset Value: 0000h
The following table summarizes the PWM frequencies that result from various combinations
of operating mode, counter resolution (input clock) and pulse width resolution.
10.2.2 Period register PP3
The 16-bit period register PP3 of PWM channel 3 determines the period of a PWM cycle,i.e.
the frequency of the PWM signal. The hardware compares the contents of the PP3 register
Input Clock and
Mode (Counter
resolution)
8-bit PWM
resolution
10-bit PWM
resolution
12-bit PWM
resolution
14-bit
PWM
resolution
16-bit
PWM
resolution
f
CPU
Mode 0
f
cpu
/2
8
f
cpu
/2
10
f
cpu
/2
12
f
cpu
/2
14
f
cpu
/2
16
f
CPU
/ 64
Mode 0
f
cpu
/64x2
8
f
cpu
/64x2
10
f
cpu
/64x2
12
f
cpu
/64x2
14
f
cpu
/64x2
16
f
CPU
Mode 1
f
cpu
/2x2
8
f
cpu
/2x2
10
f
cpu
/2x2
12
f
cpu
/2x2
14
f
cpu
/2x2
16
f
CPU
/ 64
Mode 1
f
cpu
/
2x64x2
8
f
cpu
/
2x64x2
10
f
cpu
/
2x64x2
12
f
cpu
/
2x64x2
14
f
cpu
/
2x64x2
16
Table 30 PWM frequency by operating mode, counter and pulse width resolution
5
4
3
2
1
0
11
10
9
8
7
6
15
14
13
12
rw
PT3