207

CHAPTER 9 12-BIT PPG TIMER

If the set "H" width is equal to or greater than the set cycle period, "H" level outputs occur.

12-bit PPG Function

The timer’s programmable pulse output generator function can be used as a 12-bit PPG because it can set a

cycle period and "H" pulse width of output pulse waveforms separately. A range of controllable duty cycles

is 0.02% to 100%. However, the smaller the compare value for the cycle period, the lower the resolution

(the greater a minimum-step duty cycle).

If the compare value for the cycle period is "2", a comparative setting of "H" pulse width is 1 or 2 (a duty

cycle of 50% or 100%) and the resolution is 1/2.

An output frequency and a duty cycle can be calculated using the following equations:

Output pulse cycle period = Compare value for cycle period × Count clock cycle period

Duty cycle = Compare value for "H" width/Compare value × 100(%)

Table 9.1-2 lists available resolution values, minimum-step duty cycles, and output pulse cycle periods.

=10 × 2 × 0.32 µsCycle period = Compare value for cycle period × Count clock cycle period= 011110H (30-clock period) × 2 × 4/FCH= 30 × 2 × 0.32 µs = 19.2 µs"H" width = Compare value for "H" width × Count clock cycle period= 001010B (10-clock width) × 2 × 4/FCH=6.4 µs

Table 9.1-2 Resolutions and Output Pulse Cycle Periods Supported when the Timer is Used as a 12-bit

PPG (1/2)

Compare
value for
cycle
period
Range of
available
compare
values for
"H" width
Output pulse cycle period
Resolution Minimum-
step duty
cycle
Count clock
= 2 tINST
Count clock
= 4 tINST
Count clock
= 16 tINST
Count clock
= 256 tINST
0- Unavailable
1-
21, 2
4 tINST 8 tINST 32 tINST 512 tINST 1/2 50.0%
31 to 3
6 tINST 12 tINST 48 tINST 768 tINST 1/3 33.3%
41 to 4
8 tINST 16 tINST 64 tINST 1024 tINST 1/4 25.0%
51 to 5
10 tINST 20 tINST 80 tINST 1280 tINST 1/5 20.0%
61 to 6
12 tINST 24 tINST 96 tINST 1536 tINST 1/6 16.7%
71 to 7
14 tINST 28 tINST 112 tINST 1792 tINST 1/7 14.3%
81 to 8
16 tINST 32 tINST 128 tINST 2048 tINST 1/8 12.5%