Author Topic: Raspberry pi HAT, audio amplifier  (Read 2908 times)

0 Members and 1 Guest are viewing this topic.

Offline axelbyTopic starter

  • Newbie
  • Posts: 3
  • Country: se
Raspberry pi HAT, audio amplifier
« on: January 13, 2021, 09:20:13 pm »
I just finalized my first version of a Raspberry Pi HAT based on the TI TAS5760M, a class d audio amplifier chip. It's my first serious PCB design so I'm hoping for some good feedback on possible improvments :)

The intention with the HAT is to create a wireless multi room speaker system. It should be compact, affordable and with good sound quality, meaning definetly not bad but not necessarily true HiFi. So quite subjective requirements but hopefully it somewhat describes what I'm aiming for.
The BOM is not fully finalized but should end up at 45€ for a mono and 50€ for a stereo configuration, as the mono configuration can have a depopulated output filter. The design currently has two jumpers to configure the filter part of the layout for stereo or mono setup. I'm a bit unsure whether this is a good solution or if I should just make two versions, one for stereo and one for mono. As for now I'm planing to build 5 mono boards and 1-2 stereo boards.

I chose the TAS5760 as:
  • it accepts I2S as input, thus no need for an additional DAC, digital audio all the way to the amplifier
  • configurable to stereo/mono
  • decent distorion and fair amount of power
  • powerpad (gives compact design since no need for heatsink)


The board has a fuse and over/under-voltage protection as input power protection. To power all circuits, other than the amplifier power stage, there's a 5V and 3.3V DCDC, LMR33630ADDA and LMR33610ADDA. A PLL1708 generates a master clock for the amplifier. This IC is controlled with I2C and can generate various clock signals that are multiples of common audio sampling frequencies. The I2S clocks(Left/Right and Bit) are divided from the master clock using 74HC74 IC:s as frequency dividers. Conversion between 3.3V and 5V logic levels is done with a TXB0104.


I've taken the, what I think is, the easy way by using a 4 layer design as the price doesn't seem to differ that much, currently loking at JLCPCB.
  • First layer is signal-layer with a ground pour.
  • Second layers is solid ground plane.
  • Third layer is powerplane, divided into VDD, 5V and 3.3V.
  • Fourth layer is signal layer with ground pour

With all ground pours I'm aiming for good thermal performance as the PCB is the only heatsink. I'm now doing some reading on PCB design on how to avoid groundloops and other issues that can reduce sound quality.

As I'd like a compact design most components are SMD. Most passive components are 0603 as I can handsolder those without to much problems. I'm however a little tempted to use some 0402 capacitors, especially for the bootstrap-capacitors C32-35, as the PCB feels a bit crowded there. I've ordered a 0402 practice soldering kit to see if I and my soldering iron is up for the challenge. Is there any drawback or things that require extra attention when using smaller components, as long as they have the correct electrical specifications?

As the PCB currently is larger than the Raspberry Pi footprint I've been thinking of moving some IC:s to the bottom side. This would somewhat complicate my layout with a powerplane divided into different voltages. Are there any other risks with that? Such as noise or interference?

At some of the smaller filled copper zones on the top layer I've removed the thermal reliefs as the connection becomes quite thin otherwise. Especially the decopuling caps, C22 and C24, on the amplifier. Does this only make it harder to solder or is the wider solid track beneficial?

Any feedback regarding the attached PCB layout is very welcome :)
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: ca
    • VE7XEN Blog
Re: Raspberry pi HAT, audio amplifier
« Reply #1 on: January 13, 2021, 10:25:36 pm »
Does the Raspberry Pi software implementation require the clock dividers? It seems that the peripheral itself can generate the bit clock and LR clock on its own, which should allow you to eliminate the clock divider entirely. I am also not sure why you are using 5V on this board at all, as the RPi, PLL1708, and TAS5760 all support 3.3V logic. Is this just to support the divider logic? If so (and you need this logic at all), just use a 3.3V logic family. In either case, you can also eliminate the level shifter (I guess you need the 5V DC-DC anyway to power the Pi itself).

TAS5760 is only good for 12W of clean power, which is maybe barely sufficient depending on your listening habits and speaker efficiency, but I would want a bit more headroom. I have personally looked into doing a design for something very similar based on TAS5805 which offers more like 20W of clean power, and it is actually in a smaller package and requires a simpler output filter! You do lose the headphone amp but you don't seem to be using it anyway.

Layout-wise I don't have much comment, but I'm hardly an expert. Sound quality wise I'd think the only things that really matter are inside the amplifier and in your power layout, which looks good to me. I would definitely run the numbers regarding power dissipation, though, just to be sure. You will mostly likely dissipate several watts in the amplifier at full power.
73 de VE7XEN
He/Him
 

Offline axelbyTopic starter

  • Newbie
  • Posts: 3
  • Country: se
Re: Raspberry pi HAT, audio amplifier
« Reply #2 on: January 18, 2021, 07:57:29 pm »
The Raspberry Pi can generate LR and BIT-clock but not the MCLK. My understanding was that the MCLK must have a fixed ratio to LR/BIT-clock. If LR/BIT-clock are generated from the Pi and MCLK from the PLL1708 then they will likely not be on exactly the wanted multiple, some drifting could be expected? Perhaps this is not an issue, I'll check the datasheet and ask TI.
Just as you say the 5V is needed to power the raspberry pi, but the more IC:s that can be removed the better :)

Is it only 12W with decent sound quality? The distorsion curve seems ok up to 30W at 8 Ohms at 24V, both in mono in stereo. There's no distorsion curve with a 30V supply but I'd assume it would be slightly better than at 24V?

Thanks for your points!

EDIT:
30V was absolute maximum rating. Maximum recommended rating of supply voltage is 26.4V. So 30W is more or less maximum power even when supplying 26.4V.
« Last Edit: January 18, 2021, 08:09:03 pm by axelby »
 

Offline ve7xen

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: ca
    • VE7XEN Blog
Re: Raspberry pi HAT, audio amplifier
« Reply #3 on: January 19, 2021, 03:45:14 am »
Quote
The Raspberry Pi can generate LR and BIT-clock but not the MCLK. My understanding was that the MCLK must have a fixed ratio to LR/BIT-clock. If LR/BIT-clock are generated from the Pi and MCLK from the PLL1708 then they will likely not be on exactly the wanted multiple, some drifting could be expected? Perhaps this is not an issue, I'll check the datasheet and ask TI.

Kind of an odd choice on Broadcom's part, I assumed it could, kinda makes for a not-very-integrated solution if you intend to use the I2S. You're right, MCLK probably does need to run at a fixed ratio to LRCLK, so this might be a problem if you can't clock the PLL from the RPi clocks somehow. I'm not sure if it actually matters that they be synchronous, but it is generally assumed. I believe you can save 2 ICs by using 74163 counters instead; I did BCLK/LRCLK generation years ago with 2x74LVC163.

Quote
Is it only 12W with decent sound quality? The distorsion curve seems ok up to 30W at 8 Ohms at 24V, both in mono in stereo. There's no distorsion curve with a 30V supply but I'd assume it would be slightly better than at 24V?

Not sure what I was looking at now tbh, it looks like you can expect 20W of clean power into 8ohm at 24V. If it's not thermally limited, you should be able to eek out a couple more watts at 30V supply, 25W at most I would guess.
73 de VE7XEN
He/Him
 
The following users thanked this post: axelby

Offline jaycee

  • Regular Contributor
  • *
  • Posts: 206
  • Country: gb
Re: Raspberry pi HAT, audio amplifier
« Reply #4 on: January 20, 2021, 06:56:07 pm »
Run the whole lot off of 3.3V. The clock division can be done just as well using 3.3V powered logic. 74LVC74 will work fine.

As you are generating your own MCLK, you do indeed need to divide to get suitable BCLK and LRCLK, but in addition to feeding them to the TAS, but also to the Broadcom SoC. It does have a mode where the BCLK and LRCLK pins are inputs - this is known as slave mode. Alternatively to the PLL1708 and divider logic, consider the WM8804 - it can be used as a audio clock generator alone, although you could pretty much add an SPDIF output "for free".

Be aware that you may need to develop a driver for this board! This was my own stumbling block - even though I am a software developer, I have NFI about writing drivers on Linux! I dont think you actually need to write any code as such, but you need to work out how to connect it all up via DeviceTree.

 

Offline axelbyTopic starter

  • Newbie
  • Posts: 3
  • Country: se
Re: Raspberry pi HAT, audio amplifier
« Reply #5 on: January 24, 2021, 09:06:54 pm »

As you are generating your own MCLK, you do indeed need to divide to get suitable BCLK and LRCLK, but in addition to feeding them to the TAS, but also to the Broadcom SoC. It does have a mode where the BCLK and LRCLK pins are inputs - this is known as slave mode. Alternatively to the PLL1708 and divider logic, consider the WM8804 - it can be used as a audio clock generator alone, although you could pretty much add an SPDIF output "for free".

The WM8804 looks really interesting. I was also planing for a toslink to i2s HAT as part 2 of the project but now I can use the pcb for both. Also saves space since there's no need for the 74LVC74s!
Finding a 3.3V Toslink connector however seems quite the task. What I've found is the torx147 but it's discontinued :(
The currently available TORX1353/1355/1950 are 5V devices. Need to do some digging here.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->