English
Language : 

MC68HC908LB8_05 Datasheet, PDF (111/234 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
HRP Programming Examples
Example 2
This example shows how to configure the module to output a frequency of 81.5 kHz, with a deadtime of
10 µs. The system has an HRPCLK of 8 MHz, and the switching frequency must be less than 100 Hz.
Period (seconds) = -1---0----–--3- = 12.2699 ¥ 10–6 = -P----[--1----0---:--0---]- + -I--N----T----⎝⎛----S--------T-2------E-S------E-P----L-----[[--2---4--:--0--:---]-0-------]--⎠⎞--
81.5
8 ¥ 106 -------3---2--------- ¥ 8 ¥ 106
2SEL[2:0]
(EQ 10-21)
P[10:0] + I---N----T----⎝⎛---S---------T-2------E-S------E-P----L-----[[--2---4--:--0--:---]-0-------]--⎠⎞-- = 12.2699 ¥ 8 = 98.1592 = 98 + 0.1592
-------3---2---------
2SEL[2:0]
(EQ 10-22)
P[10:0] = 98 = $62 and I---N----T----⎝⎛---S---------T-2------E-S------E-P----L-----[[---2--4--:--0--:---]-0-------]--⎠⎞-- = 0.1592
-------3---2---------
2SEL[2:0]
(EQ 10-23)
If we use 32 steps, simplifying the last equation gives
S-----T---E----P-----[--4---:--0----] = 0.1592
32
(EQ 10-24)
STEP[4:0] = 0.1592 ¥ 32 = 5.094 = 5 or 6
(EQ 10-25)
If we choose STEP[4:0] = 5, the output frequency = 81.5027 kHz.
In this case (using the output of the dual frequency generator as source for the dithering timebase),
Switching Frequency = -O----u---t--p----u---t---F----r--e---q----u---e---n----c---y- = 8----1---.--5---0---2----7-- = 2.5469 kHz
2SEL
32
(EQ 10-26)
To achieve a switching frequency of less than 100 Hz, we must use the 16-bit timebase counter as the
source for the dithering timebase.
Switching Frequency = --------H----R-----P----C-----L----K---------
HRPTB ¥ 2SEL
(EQ 10-27)
HRPTB = --H----R-----P----C-----L----K--- = ---8----Â¥-----1----0---6--- = 2500 = $9C4
100 ¥ 2SEL 100 ¥ 32
(EQ 10-28)
To insert a 10 µs deadtime in the output signals, we must calculate the value to store in the HRPDT
register from the following equation.
Dead Time = ---H-----R----P----D----T-----
HRPCLK
(EQ 10-29)
10 ¥ 10–6 = -H----R----P----D-----T--
8 ¥ 106
(EQ 10-30)
i.e. HRPDT = 10 ¥ 8 = 80 = $50
(EQ 10-31)
MC68HC908LB8 Data Sheet, Rev. 1
Freescale Semiconductor
111