Professional Documents
Culture Documents
PIC16F Full-Bridge Class D Audio Amplifier: Author: Willem J. Smit Microchip Technology Inc
PIC16F Full-Bridge Class D Audio Amplifier: Author: Willem J. Smit Microchip Technology Inc
TriangularWave
AnalogAudio
AnalogAudio
When amplifying the PWM output, either a half- or full- provide an optimal performance using a 1st or 2nd order
bridge amplifying stage can be used. As shown in LC filter. In other cases, Class D amplifier applications
Figure 1, this application of a Class D amplifier is imple- can simply rely on the speaker’s coil capacitance and
mented using a full-bridge amplifying stage, which inductance to act as a LC low- pass filter. In many
means it differentially drives the speaker. A full-bridge cases, depending on the quality of audio needed in the
topology offers greater performance over a half-bridge application, the speaker itself is a sufficient low-pass
topology by lessening rail voltage fluctuations on the LC filter.
power supply, due to the energy being fed back into it
by the amplifier.
With a full-bridge stage, there are two complementary
half-bridge stages, thus either side provides a path to
ground. Consequently, less energy is fed back to the
power supply. In addition, a full-bridge can also be
helpful at canceling out DC offsets and harmonic distor-
tion. A full-bridge topology also offers an increase in
maximum power output versus a half-bridge topology
by producing twice the swing on the speaker, because
it is being driven differentially.
The filtering stage of Class D depends on how closely
the user wants to reproduce the original input analog
signal or audio signal. The trade-off is represented by
the number of components versus retaining the original
analog signal and the resulting quality of the audio out-
put. The recommended filter for a Class D amplifier is
a low-pass LC filter.
An LC filter has no internal resistance, so it is not wast-
ing energy – which can result in lower audio volume
and reduced efficiency. Many Class D amplifiers can
MSSP DAC
EEPROM SPI/I2C 10Ͳbit Complementary
2 TC4427
SPI/I C OutputGenerator
Programmable
Ramp
Generator
(SquareWave)
Timer DAC
PWM
8Ͳbit 5Ͳbit PIC16F176X
AnalogAudio
Complementary TC4427
OutputGenerator
Programmable
Ramp
Generator
(SquareWave)
Timer DAC
PWM
8Ͳbit 5Ͳbit PIC16F176X
REFERENCES
For more information on how to use and configure the
modules mentioned in this application note, see the
following reference documents:
1. Interfacing Serial EEPROMs with 8-Bit PIC®
Microcontrollers (AN2045)
2. Complementary Output Generator Technical
Brief (TB3119)
3. Operational Amplifier Module of 8-Bit PIC®
Microcontrollers (TB3132)
4. Programmable Ramp Generator Technical Brief
(TB3140)
5. High Efficiency Solutions for Portable LED
Lighting (DS01427A)
6. PIC16(L)F1764/5/8/9 Data Sheet
(DS40001775)
AN2236
FIGURE A-1: SCHEMATICS A
VDD U1 U2A
18 16
VDD RA0/AN0/Vref-/DAC1234REF-/DAC1234OUT1/C1IN0+/C3IN0+/ICSPDAT PGD PIC_LED1
15 2 7
RA1/AN1/VREF+/DAC1234REF+/C1234IN0-/ICSPCLK PGC COG1B SPK2
17 14
C1 C2 VSS RA2/AN2/ZCD/T0CKI/COG12IN/INT COG1A
1
0.1uF 0.010uF RA3/T6CKI/DSM12CH/MCLR/VPP MCLR
20 6 3
10V 25V RA4/AN3/T1G/SOSCO/DSM12CL/OSC2/CLKOUT TX SPK_VDD VDD GND
GND 19
0603 0603 RA5/T1CKI/T2CKI/SOSCI/CLCIN3/DSM12MOD/OSC1/CLKIN BOOST_EN
TC4427A
10 GND
RB4/AN10/OPA1IN0-/SDI/SDA SDO
9 U2B
RB5/AN11/OPA1IN0+/RX SDI
GND 8
RB6/C1IN1+/C3IN1+/SCL/SCK SCK
7 4 5
RB7/C2IN1-/C4IN1+/CK EEPROM_SS COG1A SPK1
TP1 13
RC0/AN4/C2IN0-/C4IN0+/T5CKI COG1B
12 6 3
GND RC1/AN5/C1234IN1-/T4CKI/CLCIN2 RX SPK_VDD VDD GND
11
TP LOOP Black TH RC2/AN6/OPA1OUT/OPA2IN1-/OPA2IN1+/C1IN2-/C2IN2-/RG1IN0/RG2IN1 RHEO_SS
4 TC4427A
RC3/AN7/OPA2OUT/ OPA1IN1-/OPA1IN1+/C1234IN3-/RG2IN0/RG1IN1/T5G/CLCIN0 SW3
3 GND
RC4/RG1R/RG2R/T3G/CLCIN1 SW2
2
RC5/RG1F/RG2F/T3CKI/CCP1 SW1
5 U2C
RC6/AN8/OPA2IN0-/SS HOLD
6 1 8
RC7/AN9/OPA2IN0+ WP NC NC
PIC16F1769-I/ML
LD1 6 3
R9 SPK_VDD VDD GND
J1
PIC_LED1 VDD
TC4427A
MCLR 430R
5 4 3 2 1
BLUE GND
VDD 0603 C3
GND 5% 0.1uF
PGD 10V
PGC 0603
VDD
HDR-2.54 Male 1x5 1 8
EEPROM_SS CS VCC
6 GND
SCK SCK
5 2
SDO SI SO SDI C4
3
WP WP 0.1uF
VDD 10V C5
7 4
HOLD HOLD VSS 0603
R1 U3 DNP
10k GND GND 25V
0603 0603
L1 L2
5% S1 SPK1 SPK2
SW1 10uH 10uH
TACT SPST
1
2016 Microchip Technology Inc.
GND
C6 C7
0.47uF 0.47uF
VDD 25V SP1 25V
VDD 0805 0805
R2
10k R3 GND GND
0603 10k
5% S2 0603
5% S3
SW2
TACT SPST SW3
TACT SPST
GND
GND
FIGURE A-2: SCHEMATICS B
2016 Microchip Technology Inc.
R8
DNP
0603
L3 5% D1
SPK_VDD
4.7μH
PMEG2005EH,115
USB2.0 MICRO-B FEMALE R4
J2 U4 510k
1
VDD MCP1661 0805
SW
1 5%
VBUS
2 5 3
D- USB_D_N VDD VIN FB FBA
3
D+ USB_D_P C8
ID
4
C9 BOOST_EN
4
E
EN R5 10uF
5 DNP
GND 10uF 25V
D
GND
0603 FBB
25V 1206
GN
5%
G
0
1206
2
R6
GND 51k
0603
GND GND 5%
GND GND
GND
C10
VDD
0.1uF
10V C11
R7 GND 0.1uF
10k U5 0603
MCP4162 MSOP-8 10V
0603 VDD 16 13
VDD VSS U6 0603
1% 1 12
GP0 D+ USB_D_P
2 11 1 8
GP1 D- USB_D_N RHEO_SS CS VDD VDD
3 10 2 7
RST VUSB SCK SCK SDO SDI
4 9 3 6
TX UART RX SCL SDO SDI P0B FBA
5 8 4 5
AN2236
DS00002336A-page 7
GND
Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.
• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
== ISO/TS 16949 ==