Author Topic: PAM8304 - Filterless Class D amplifier clicking output  (Read 19325 times)

0 Members and 2 Guests are viewing this topic.

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
PAM8304 - Filterless Class D amplifier clicking output
« on: January 29, 2016, 09:10:25 pm »
Hi Guys,

I'm trying to integrate a PAM8304 Class D amplifier with an ARM processor to generate audio output. I followed the datasheet on the design but no luck. With a very low input I manage to get dimmed sound but as soon as I crank up the volume, the speaker starts to "click" without giving any output.

This is the design:


I thought the problem was the input, but a PWM generated sine wave looks pretty good. After adding 200nF between the speaker leads I get a little bit more volume before it started clicking.

There is probably a simple solution I'm missing but does anyone have an idea what I'm doing wrong here?
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #1 on: January 30, 2016, 01:24:34 pm »
Performed some more testing(I'm a complete noob at audio circuits):

When replacing the 10nF ceramic caps with 1µF elco's, I do get a loud output for a few seconds before it stops(I guess charging of the elco's). When I remove the IN- capacitor and directly connect the resistor to ground and leave the 1µF cap at IN+ I do get sound but the speaker is running quite hot.

What kind of noobish mistake am I making here?
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: us
  • Very dangerous - may attack at any time
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #2 on: January 31, 2016, 12:43:59 am »
What kind of noobish mistake am I making here?

PCB layout can cause some strange behavior.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #3 on: January 31, 2016, 10:42:16 pm »
The PAM8406 sets maximum RF =142k, minimum RI =18k, so the maximum closed-gain is 24dB.

For the 8304, RF=300k

In the case of the 8304, both Rin resistors should match in value and likely conform to the limits above.

Make sure if you are polarizing any polarized electrolytic caps properly.

Note that the reference design doesn't give any values for Rin.
« Last Edit: January 31, 2016, 11:22:36 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #4 on: January 31, 2016, 11:16:00 pm »
What kind of noobish mistake am I making here?

PCB layout can cause some strange behavior.
Tried two completely different designs, both gave the same result. :(

The PAM8406 sets maximum RF =142k, minimum RI =18k, so the maximum closed-gain is 24dB.


In the case of the 8304, both Rin resistors should match in value and likely conform to the limits above.

Make sure if you are polarizing any polarized electrolytic caps properly.

Note that the reference design doesn't give any values for Rin.
Rf = 300k and I tried a 10k, 82k, 150k and 330k at Rin. I figured one had to give some result.. No luck. As input I used ceramic X7R caps.
The only way for it to work now is remove the input caps(so one Rin=150k goes to ground directly, the other connected to the source). The source is decoupled with a 1µF cap.

This does in fact work. but I expected much more volume from the speaker. It could be that I'm expecting too much as it is only a 34*40mm 4 Ohm speaker.
At 4 meters distance, you can just hear what the voice is saying in a quiet room.

It is still not as described in the example schematic and I don't understand why! When I analyse the output without speaker I get big short peaks as what I hear so the speaker load is not too big for the chip to handle or at least is not causing the issue.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #5 on: January 31, 2016, 11:19:02 pm »
Gv = Closed-loop Gain VDD = 2.8V to 5V            Gv =  300K/Rin V/V and both resistors must be the same value.


150k gives a gain of two, you might need Rin= something more like 20k.

« Last Edit: January 31, 2016, 11:23:35 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #6 on: January 31, 2016, 11:25:42 pm »
Gv = Closed-loop Gain VDD = 2.8V to 5V            Gv =  300K/Rin V/V and both resistors must be the same value.
Yes, that is what I did. Both are called RIN so I changed the resistors in pairs for testing. Otherwise of course you have a difference in the op-amp and the speaker will be pulled in one direction.

Quote
150k gives a gain of two, you might need Rin= something more like 20k.
The input source is 1Vpp. With this small gain of only 2, shouldn't I at least hear something but very softly? I tried 10k(the development board uses 10k) as well and it just made it worse. I had to turn down the potmeter almost completely to get any sound.
« Last Edit: January 31, 2016, 11:27:29 pm by fantasy2 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #7 on: January 31, 2016, 11:26:41 pm »
What do you measure in P-P at the junction of Rin- input Cap?

Try using a larger bypass capacitor from Vdd to ground and keep leads short.

Also try connecting a .1uf in series with a 4.7 ohm resistor across the speaker outputs.


You've posted: "When replacing the 10nF ceramic caps with 1µF elco's, I do get a loud output for a few seconds."

When polarized capacitors are used the positive side of the capacitor should face the amplifier input in most
applications as the DC level is held at VDD/2, which is likely higher than the source DC level. Please note that it is important to confirm the capacitor polarity in the application.


10nF caps are much too small if Rin = 20k.

Are you getting Vdd/2 at the input pins? Output Pins? Is the chip overheating? Do you see high freq. residual PWM noise at the input-cap-res junction?

Finally, scope or measure the Vdd during operation, the instantaneous current may be overloading your P/S.

Did you scope the output..(assumes you have scope!)

Is Sound En pin > 2.8 V?
« Last Edit: January 31, 2016, 11:46:05 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #8 on: February 12, 2016, 02:59:27 pm »
What do you measure in P-P at the junction of Rin- input Cap?

Try using a larger bypass capacitor from Vdd to ground and keep leads short.

Also try connecting a .1uf in series with a 4.7 ohm resistor across the speaker outputs.


You've posted: "When replacing the 10nF ceramic caps with 1µF elco's, I do get a loud output for a few seconds."

When polarized capacitors are used the positive side of the capacitor should face the amplifier input in most
applications as the DC level is held at VDD/2, which is likely higher than the source DC level. Please note that it is important to confirm the capacitor polarity in the application.


10nF caps are much too small if Rin = 20k.

Are you getting Vdd/2 at the input pins? Output Pins? Is the chip overheating? Do you see high freq. residual PWM noise at the input-cap-res junction?

Finally, scope or measure the Vdd during operation, the instantaneous current may be overloading your P/S.

Did you scope the output..(assumes you have scope!)

Is Sound En pin > 2.8 V?
Hi Paul,

Thanks for your extensive response. Unfortunately I was caught my a flu not being able to test anything out.

I soldered a new board and used 100nF ceramic caps and 22k at both input stages.
The enable pin is pulled to Vcc(5Volt) with a 10k Ohm resistor and there is a 1µF ceramic cap and a 1000µF elco close to the supply.

I do measure 2.5 Volt (1/2Vcc) at the input stages which is good. Input is about 1Volt P-P single ended.
On the output pins I measure 0.9Volt referenced to ground.

I still do not get any sound output!

One thing I noticed that is different from the reference design is that I routed VDD and PVDD together to the power supply. The application note separates them.
« Last Edit: February 12, 2016, 03:37:55 pm by fantasy2 »
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #9 on: February 12, 2016, 03:59:36 pm »
Have you tried adding a capacitor (for example 10uF) in series with the speaker? That will block the DC path through the speaker and will help if the chip is running hot.
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #10 on: February 12, 2016, 04:26:05 pm »
Yes I tried that but no luck. Using the correct schematic the speaker doesn't get hot: the outputs don't seem to pull the speaker in any direction.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #11 on: February 12, 2016, 08:11:48 pm »
From what you describe, especially with no output, this strongly suggests a miswiring of the circuit or chip.  Any chance you've made a mistake here?
Although some chips are a little sensitive to layout than would be desired, it should be too hard to get this simple circuit to work.
(1) is the partnum correct?
(2) Is the chip orientated(not reversed nserted?)
(3) Do you have a bad chip (unlikely.).

Maybe take a pic and post the front and back of your PCB or breadboard to allow someone else's eye to spot an error?

Check each part (i.e. is your speaker fried and shorted-out and produces no sound, have  you a 1meg where a 1k resistor is required..etc.)
« Last Edit: February 12, 2016, 09:17:17 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #12 on: February 12, 2016, 10:44:39 pm »
Well, I don't get any output when I follow all the directions you and the datasheet gave. When I change some stuff(like removing the cap at the IN-) it does give me an output and the speaker is pulled into a certain direction.

I fried one or two by doing this. None of those chips gave any bias voltage at the input afterwards. The one I have fresh on the board still does give the 1/2Vcc(and more important I didn't abuse it yet!).

Here is the board:


Datasheet pinout:
« Last Edit: February 12, 2016, 10:50:05 pm by fantasy2 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #13 on: February 12, 2016, 11:00:12 pm »
Your PCB layout for the enable/Shutdown pin shows the pin connects to a via and not anything else???

EN/SD should be tied to Vdd +5
« Last Edit: February 12, 2016, 11:20:50 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #14 on: February 12, 2016, 11:05:56 pm »
Your PCB layout for the enable/Shutdown pin shows the pin connects to a cap and not anything else???

EN/SD should be tied to Vdd +5

No, the "enable" is connected further down to a microcontroller, I verified that it is working at the via under the chip.
Same goes for the +input. But at that pad I now connected a real audio source instead of one generated by a microcontroller

Just cut some bits off that are not relevant/for the sake of simplicity.

When I change EN/SD from ground pulled to 5Volt you see the chip waking up by making the inputs 1/2Vcc.
« Last Edit: February 12, 2016, 11:14:33 pm by fantasy2 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #15 on: February 12, 2016, 11:14:59 pm »
You are saying you can see that EN/SD is being held at ~5V by the MCU and you can see an input audio signal?

The view you are showing of the PCB is top view and the chip is being mounted SMD top?

No solder bridges?

If so, the only possibility left is you have a bad chip.
« Last Edit: February 12, 2016, 11:18:34 pm by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #16 on: February 12, 2016, 11:19:58 pm »
Correct. I can see all that.
It is indeed the top view. Red = top layer; Blue = bottom layer.

If the chip is bad, I have 4 bad chips from two different badges. That's why it is so confusing to me. I don't see what I am doing wrong.

There are no solder bridges under the microscope.

« Last Edit: February 12, 2016, 11:33:29 pm by fantasy2 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #17 on: February 12, 2016, 11:26:20 pm »
Have you cleaned your PCB and checked with an ohmmeter for leakage/solder bridges between pins?
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #18 on: February 12, 2016, 11:29:42 pm »
Have you bought your badges from Short-Circuit Chip Supply?
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #19 on: February 12, 2016, 11:34:42 pm »
Have you cleaned your PCB and checked with an ohmmeter for leakage/solder bridges between pins?
Yes I did.

Have you bought your badges from Short-Circuit Chip Supply?
Directly from Mouser which is an official distributor.




I'm still not sure about that gain setting. Some last thing to check:
- Input is 1Volt P-P
- Output is 5Volt(Vcc)

The datasheet describes the closed loop gain as 300k/Rin in V/V(not Decibel !).
This would suggest I need a Rin = ~60k Ohm and not 22k.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #20 on: February 12, 2016, 11:39:55 pm »
The output should be 2.5V  not 5V.

Have you checked for leakage/bridges at all the IC pins?

The gain set resistors are not the problem.
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #21 on: February 12, 2016, 11:53:49 pm »
I checked and all are OK. The boards are made by a professional shop. Measuring the traces of empty boards I don't find anything wrong with the boards either.

If you're interested in sharing my frustrations I can send you a few chips..
« Last Edit: February 13, 2016, 12:00:22 am by fantasy2 »
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #22 on: February 13, 2016, 12:01:35 am »
If this is true then what you need is an exorcist, not an engineer for help.
Please fill in the following form for the circuit powered up and fed an audible signa:

Voltages/Waveform/DC-Level Chart to be filled out
Pin          P-P WaveForm              Scoped               DC Level
1
2
3
4
5
6
7
8
« Last Edit: February 13, 2016, 12:08:45 am by Paul Price »
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #23 on: February 13, 2016, 12:14:58 am »
I have better equipment at work so will do these measurements in the course of the coming week.

Thanks for all the help so far! Highly appreciated!
 

Offline fantasy2Topic starter

  • Contributor
  • Posts: 17
  • Country: nl
Re: PAM8304 - Filterless Class D amplifier clicking output
« Reply #24 on: February 26, 2016, 08:50:27 pm »
Took some more effort to get the scope from work so I finally bought one. :)

It seems there is no signal arriving at the input. Is my input resistor value still too high or the input too weak to pull the bias voltage at the inputs around?! Or do I perhaps have weird resistors?


Channel 1(yellow) = Sine wave input
Channel 2(cyan) = pin

Signal before positive input resistor:


Pin 4(negative input) - Bias voltage is OK:


Pin 5(positive input) - Bias voltage is OK but no waveform:

Nothing!

Pin 2 & 3(Supply 5Volt):
« Last Edit: February 26, 2016, 09:04:45 pm by fantasy2 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf