Datasheet

Using the Output Compare 7 Feature to Generate a PWM
M68HC12B Family Data Sheet, Rev. 9.1
Freescale Semiconductor 139
11.4.1 PWM Period Calculation
These parameters were used to calculate the high-time values shown in
Table 11-3:
Period = $1000 (Hex) = 4096 (decimal)
E clock = 8 MHz
Prescaler = 4
Frequency = (8 MHz) / (#clocks_count*prescaler) = (8 MHz) (4096*4)
= 500 Hz
If period ($4096 Clocks) => frequency = 500 Hz
11.4.2 Equipment
For this exercise, use the M68HC912B32EVB emulation board.
Table 11-3. PWM Period Calculations
High-Time Values
Duty Cycle
HEX Count Decimal Count
$0020 32 0%
$0040 64 1.5%
$0080 128 3.1%
$0100 256 6.25%
$0200 512 12.50%
$0040 1024 25.00%
$0080 2048 50.00%
$0996 2454 60.00%
$0C00 3072 75.00%
$0D9A 3482 85.00%
$1000 4096 100.00%