English
Language : 

MC68HC908LB8_05 Datasheet, PDF (100/234 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
High Resolution PWM (HRP)
The formula for calculating the output duty cycle in variable duty cycle mode is:
Output Duty Cycle = D-----C-----[--1----0---:--0----] + ---I--N-----T----⎝⎛----S--------T2------E--S------EP----L------[[--2--4--:--0--:----]0--------]--⎠⎞----
HRPCLK -------3---2--------- ¥ HRPCLK
2SEL[2:0]
where 2SEL[2:0] is the STEP[4:0] scaling factor.
In Variable Duty Cycle Mode, the individual periods and duty cycles are given by:
PERIOD1 = ---P----[--1---0----:-0---]---
HRPCLK
DUTY1 = DC[10:0]
PERIOD2 = PERIOD1 = ---P----[--1---0----:-0----]--
HRPCLK
DUTY2 = DUTY1 + 1 = DC[10:0] + 1
(EQ 10-6)
(EQ 10-7)
(EQ 10-8)
(EQ 10-9)
(EQ 10-10)
10.4.7 Dithering Controller
The dithering controller consists of a 5-bit counter with programmable modulus. The counter contents are
compared with a scaled version of the STEP[4:0] bits.
The modulus value (i.e., the total number of steps) and the STEP[4:0] scaling factor are set by the SEL
bits in the HRP configuration register. Table 10-3 lists the available options. Note that the scaling of the
STEP[4:0] bits is linked to the modulus value. For example, if a modulus of 32 is chosen, STEP[4:0] is not
scaled (32 steps of dithering are available). If a modulus of 16 is chosen, STEP[4:0] is divided by 2, so
that only 16 steps of dithering are available.
Table 10-3. Number of Steps and Step Scaling
SEL
Number of Steps
0
32
1
16
2
8
3
4
4
2
5
0
6
Reserved
7
Reserved
Divide STEP[4:0] by...
1
2
4
8
16
32
Reserved
Reserved
For example, if you decide to have 16 steps (SEL = 1) instead of the maximum of 32, and you set
STEP[4:0] equal to 23, then the scaled value of STEP will be 11 (i.e., the integer part of 23 divided by 2).
If you decide to have 4 steps instead of 32, the scaled value of 23 would be 2 (the integer part of 23 divided
by 8).
MC68HC908LB8 Data Sheet, Rev. 1
100
Freescale Semiconductor