
MOTOROLA
MC68328 DRAGONBALL PROCESSOR USER’S MANUAL
11-1
SECTION 11
PULSE-WIDTH MODULATOR
The pulse-width modulator (PWM) provides high-quality sound generation and accurate
motor control. This section describes the PWM block.
11.1 OVERVIEW
The PWM is a simple free-running counter with two “compare” registers that each perform
a particular task when they match the count value. The period comparator sets the output
pin and the free-running counter resets when its value matches the period value. The width
comparator resets the output pin when the counter value matches. With a suitable low-pass
filter, the PWM can be used as a digital-to-analog converter.
The output pin feeds a stream of sample values to the PWM into the width register and pro-
vides a low-pass filter on the output. It also provides a high-quality, digitally generated sound
source. The selected period determines the reconstruction rate. Typically for voice quality,
the rate will be between 6 kHz and 8 kHz. The following figure relates the pulse stream to
the filtered audio output.
The width and period registers are double-buffered so that a new value can be loaded for
the next cycle without disturbing the current cycle. At the beginning of each period, the con-
tents of the buffer registers are loaded into the comparator for the next cycle. Sampled audio
can be recreated by feeding a new sample value into the width register on each interrupt.
Figure 11-1. PWM Block Diagram
Figure 11-2. PWM Generating Audio
WIDTH COMPARE
PWMOUT
OUTPUT
CONTROL
PRESCALER
PERIOD COMPARE
COUNTER
SYSCLK
Pulse Stream
Filtered Audio
Summary of Contents for DragonBall MC68328
Page 5: ...vi MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...
Page 25: ...Overview 1 14 MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...
Page 45: ...System Integration Module 2 20 MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...
Page 103: ...Parallel Ports 7 16 MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...
Page 117: ...UART 8 14 MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...
Page 127: ...SPI Master 10 6 MC68328 DRAGONBALL PROCESSOR USER S MANUAL MOTOROLA ...