Silicon Laboratories AN726 User manual

Rev. 0.1 11/12 Copyright © 2012 by Silicon Laboratories AN726
AN726
UTILITY CLASS-D TOOLSTICK USER’SGUIDE
1. Introduction
Class-D is a switching power amplifier architecture that uses high-frequency Pulse-Width Modulation (PWM) to
generate the output waveform. The transistors are fully on or fully off, which means this architecture can reach very
high efficiency levels, resulting in significant power savings. However, the translation from the input signal to PWM
and the PWM itself can cause more distortion on the output than other amplifier architectures. Figure 1 shows a
very basic Class-D signal diagram.
Figure 1. Class-D Power Amplifier Signal Diagram
Because the Class-D amplifier transistors are fully on or fully off, the transistors lose less energy in the form of
heat. This architecture, therefore, lends itself to small, cheap MOSFETs. The Class-D amplifier can be
implemented in either analog or digital form.
An analog Class-D amplifier is non-trivial and typically consists of a comparator, triangle waveform generator, and
several blocks to condition the input signal before transferring to the output MOSFETs.
A digital Class-D amplifier requires the following:
PWM output (switching) frequency 10x+ faster than the highest input frequency to adequately reconstruct
the input signal
High-resolution control of the PWM pulse width to reduce output quantization distortion
Method for sampling or receiving the input waveform
Fast core for digital processing and manipulation of data
Pins capable of driving the amplified signal
Since the Silicon Labs Precision32™ SiM3U1xx/SiM3C1xx 32-bit MCUs have peripherals and features capable of
meeting all of these requirements, these MCUs are uniquely suited to a utility Class-D power amplifier application
without using many external components by directly driving the speaker using the high drive I/O.
In addition to providing a development platform for Class-D applications, the Class-D ToolStick board serves as a
lower-cost, general-purpose development platform for the SiM3U1xx USB MCUs.
2. Relevant Documents
This document provides a hardware and software overview for the Class-D ToolStick. Additional documentation on
the Precision32 tools and MCUs can be found on the Silicon Labs website: www.silabs.com/32bit-appnotes,
www.silabs.com/32bit-software, and www.silabs.com/32bit-mcu.

AN726
2 Rev. 0.1
3. Using the Demo
The speaker in the kit connects to the JP1 1x2 header next to the green terminal block (J4). Two alternate
connection methods are available to support a variety of speakers: the J4 terminal block, and an output audio jack
(J5). A screwdriver can be used to attach the speaker(s) of choice to J4, and each speaker should have two leads:
positive (red) and negative (black). The audio jack output connects both channels of the speaker to R+ and R–, so
it is not true mono. The Class-D ToolStick board is intended for use with stereo systems.
The Class-D ToolStick can be powered from either the Debug (J3) or Device (J2) USB mini connectors as shown in
Figure 2. The green POWER LED (DS7) will light up when the board is powered. Do not touch the Capacitive
Sensing slider during power-on, as this is when the board calibrates the slider. Once the board is ready for use, the
blue LED (DS1) will turn on.
Figure 2. Powering the Board
Change the volume of the output at any time by pressing firmly and sliding on the Capacitive Sensing slider (CS1).
The blue LEDs above the slider indicate the volume level.
The MODE button on the slider can be used to change the mode of the board:
Mode 1 (blue LED DS1): Stereo Jack Input Mode
Mode 2 (blue LED DS2): USB Input/Output Mode
Mode 3 (blue LED DS3): Play Prerecorded Flash Mode
Mode 4 (blue LED DS4): Play/Record Flash Mode

AN726
Rev. 0.1 3
3.1. Stereo Jack Input Mode
The default mode of the Class-D ToolStick is stereo jack input mode, indicated by blue LED DS1. To play sound in
this mode, connect any input source (MP3 player, phone, etc.) to the J1 stereo jack. The volume level of the input
device should be as high as possible without causing saturation, which the red LED (DS8) indicates.
3.2. USB Input/Output Mode
In USB mode, the board plays sound from the USB host PC or records sound from the board microphone (MK1)
and sends it up to the PC. To use the board in this mode, connect the Device USB connector (J2) to the host PC
and press the MODE button until blue LED DS2 turns on. The board should appear as the Utility Class-D
ToolStick in Device Manager once it’s properly enumerated as a USB Audio device.
To select the Class-D Audio device as the Playback or Recording source in Windows 7, right-click on the Volume
Mixer icon in the System Tray and select either Playback devices or Recording devices. In the Playback tab of
the dialog, select the Utility Class-D ToolStick and press the Set Default button as shown in Figure 3. The
settings for the device can be selected using the Properties button in this tab.
Figure 3. Configuring the USB Utility Class-D ToolStick as the Playback or Recording Device
In the Recording tab of the dialog, select the Utility Class-D ToolStick microphone and press the Set Default
button. This will open an interface to the microphone and will display the recorded input volume to the right of the
device name. If this volume is not registering sounds, press the Properties button to configure the microphone
volume.
Once configured, any program on the PC should output to the Class-D ToolStick device. Ensure that the volume
levels in the program and Volume Mixer are set to appropriate levels. If the device volume settings are not affecting
the Class-D board, click the expansion button below the Speakers icon and select the Speakers (Utility Class-D
ToolStick) as shown in Figure 4.
When recording, the red LED (DS8) indicates when the microphone input saturates.
Note: As long as a recording interface is open (i.e. Volume Mixer Recording devices dialog or a recording program open), the
Class-D ToolStick prevents the user from switching the operation mode. This is due to potential synchronization issues
when switching between different modes and sending data up to the host PC. To switch the mode, close the Volume
Mixer or the recording program.

AN726
4 Rev. 0.1
Figure 4. Selecting the USB Utility Class-D ToolStick in Volume Mixer
3.3. Play Prerecorded Flash Mode
In prerecorded flash mode, the Class-D ToolStick will output ~7 seconds of sound from an array saved to flash.
Enter the mode by pressing the MODE button until blue LED DS3 turns on.
Press the PLAY slider button on the board to start the waveform, and press the PLAY slider button again to stop it
before it completes. The blue LED (DS6) will indicate when a play operation is in progress. This mode provides an
alternative sound input source when no sources are available and provides an indication of what sound effects
would sound like.
3.4. Play/Record Flash Mode
The play/record flash mode records compressed sound to the flash of the MCU. Enter the mode by pressing the
MODE button until blue LED DS4 turns on.
Press the REC slider button to start recording, and press the REC slider button again to stop recording. The blue
LED (DS5) will indicate when a record operation is in progress. Multiple recordings will append to the full recording
in flash. Once the flash is full, the MCU will indicate no additional recordings can be made by turning on and
immediately turning off the blue record LED. To record additional sound, press the ERASE slider button to erase
the flash. The blue DS5 LED will turn on while the erase operation is in progress. When recording, the red LED
(DS8) indicates when the microphone input saturates.
Press the PLAY slider button on the board to start the waveform, and press the PLAY slider button again to stop it
before it completes. The blue LED (DS6) will indicate when a play operation is in progress.

AN726
Rev. 0.1 5
4. Class-D ToolStick Hardware Overview
The Class-D ToolStick board enables Class-D application development on the SiM3U164 MCU. In addition to
providing a development platform for Class-D applications, the Class-D ToolStick board serves as a low-cost,
general-purpose development platform for the SiM3U1xx USB MCUs.
Figure 5 shows the Utility Class-D ToolStick board features. Full schematics for the board can be found in
7. "Schematics‚" on page 22
Figure 5. Utility Class-D ToolStick Board Features
4.1. Push-Button Switches and LEDs (S1-2, DS1-DS8)
The Class-D ToolStick board has two push-button switches and eight LEDs summarized in Table 1. The switches
connect to PB0.6 (S1) and PB0.7 (S2) and are currently unused in the Class-D firmware. The switches are
normally open and pull the pin voltage to ground when pressed.
Port pins PB0.1, PB0.2, PB0.4, PB0.5, PB0.10, and PB0.11 connect to six blue LEDs (DS1-DS6). Pin PB3.3
connects to the red LED (DS8). The green LED, POWER (DS7), turns on when USB power is applied to the board
from either USB connector. The LEDs connect to VIO through a current limiting resistor.
Table 1. Class-D ToolStick Switches and LEDs
GPIO Pin Switch or LED
PB0.6 Push-Button Switch (S1)
PB0.7 Push-Button Switch (S2)
PB0.1 Blue LED (DS1)
PB0.2 Blue LED (DS2)
PB0.4 Blue LED (DS3)
ToolStick Debug
Adapter
Audio Inputs
Stereo Jack and
Microphone Gain/Bias Capacitive Sensing
Slider and LED User
Interface
Class-D Output
Filters and
Speaker Header
Testpoint Pin Access
for General-Purpose
Development
Optional High
Power Components
Table of contents