Saturday, February 22, 2014

Digital Amplifier: First Run

It is time to turn my first amplifier board on.
Here is my first test setup:
Don't blame me for the power supply, I just scavenged transformer and capacitors from an old Sony tuner. My main concern at the moment is to test if my amplifier can produce any sound but not a sound quality which will be affected by such a power supply for sure. I will use a switching power supply soon, but I have to find a suitable one first.

It took some time to setup my BeagleBone to play music on MiniDSP USB Streamer. I will post details on that later, when I settle it out. Someone would ask me why not to use Raspberry? At the moment it doesn't support USB 2.0 audio devices well.
MiniDSP USB Streamer might be not the best in a family of USB->I2S converters since it doesn't have dedicated low-jitter clocks but it has 8 I2S channels. I'd like to test what is better - to have crossover on 5548 chip or to have it on BBB. I'll by better converter later if 5548 wins.

So what about the sound?
First pictures from the scope scared me...
Look at this (sorry, my digital scope just died):
Text is not readable on this picture but it shows PWM frequency on the output: ~1.25V at 384kHz.
Tried to switch from AD mode to BD ant got things look even worse:
What a disappointment!
But guys from TI forum told me it is expected and not a big deal. Also I found this video saying it is OK. I need to build a simple RC filter to check it out.
So I connected a junk speaker.... And spirits of electronics let me to hear the sound!

Then I found a couple of things I'm not very happy about:
  • Inductors heat up to 50 degrees Celsius even in idle mode (but PWM is on)
  • Electrolites heat up to 43 degrees Celsius. This temperature is far from critical but I'm afraid it would shorten capacitors life.
And a good thing: amplifier can easily output 25W RMS for a while without a real heatsink.

What about sound?
It sounds. My junk speaker did its best and I didn't hear any suspicious clicks, pops or any saturation that would be different from the same speaker powered with analog amp.
To test it in a real life I need to take the following steps:

  • assemble more boards (at least one since my speakers are still two-way)
  • put them on a real heatsink
  • put ceramic capacitors right under electrolytes to reduce ripple current a bit
  • calculate biquad coefficients for crossover
  • write some python code to initialize TAS5548 with crossover coefficients
  • buy a suitable switching power supply with switching frequency far beyond the audio band
still a lot of things to do... Why do people have to sleep?

Friday, February 21, 2014

TEK Scope screen is dead

Bad thing just has happened!
I was watching strange signal shape coming out from my just assembled amplifier board when picture on the scope began to jump and scary pops and clicks started to come from my nice scope.
Thunderbolts inside a scope is not a very good sign, right? So another challenge is going to begin.
To be honest I'm not a fan of scope repairing... But high voltage transformer has died tragically.
Couldn't find a transformer like that on the Internet, found just a couple of LCD kits for almost thousand bucks. Well, I believe I can do it for less because the scope has a VGA output and it should be possible to connect a regular LCD to it.
I'm afraid a new LCD would not have better picture than CRT had, but I don't have a lot of options.

I know some people who have such color Tektronix TDS scopes have dead CRTs, so maybe I can find such a folk and give my CRT to him...

Sunday, February 16, 2014

Soldered: TAS5631B amp

Here is my first amplifier board completed:

I put SMD inductors vertically while they supposed to lay on the PCB:

I have two good reasons for that - first of, it saves a lot of very limited space and the second - if the warm up it would help them to cool down (questionable, but makes me feel better).

Looks fine. Especially having in mind it is my first SMD project. Let's connect all my stuff together and check if it is able to produce any sound...


Wednesday, February 12, 2014

TAS5548 PWM Modulator board

I started with PWM modulator. What is the reason of soldering the whole amplifier board if PWM doesn't work?
And even more, my setup requires only one PWM modulator board and I have ten available. Plus 5548 has its pins on two sides only which probably can make the soldering a little bit easier.

Well, it was not that scary,
I'm not a soldering guru and I was scared about SMD components, especially chips with 0.5 and 0.6 mm pitch. But it turned out to be not such a big deal. Thanks to Steve from EEVBlog for his video tips on how to solder smd chips.
TAS5548
Not bad for the first try
The only thing I really struggled with is crystal oscillator. It has its pads underneath and I couldn't place it well. But it works and I don't want to re-solder it.

Here is my test setup:
BeagleBone Black + MiniDSP USB Streamer + my PWM modulator:
It is a whole different story how to setup BBB...
Adafruit has python libraries to drive I2C bus so here my first python program ever:
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
from Adafruit_I2C import Adafruit_I2C
 
def i2cPrint32(x): 
 bytes = i2c.readList(x, 4)
 print "%X %X %X %X" % (bytes[0],bytes[1],bytes[2],bytes[3])

i2c = Adafruit_I2C(0x1A) # see notes about I2C address below

print "5548: 0x%x = %X" % (0x01, i2c.readU8(0x01))

### UnMute
print "============="
print "CTRL:"
ctrl = i2c.readU8(0x03)
ctrl = ctrl & ~0x10
print hex(ctrl)
i2c.write8(0x03, ctrl)


### VOLUME ###
print "Master Volume:"
volume = [0,0,0,0xAF]
x = 0xD9
i2c.writeList(x, volume)
bytes = i2c.readList(x, 4)
print "%X %X" % (bytes[2], bytes[3])
it umutes the modulator and sets some non-zero volume.
And here is the output:
5548: 0x1 = 4
=============
CTRL:
0xa0
Master Volume:
0 AF

After unmute I can see 50/50 PWM duty cycle:
And when input signal is applied:
So looks like it works. On first try!

But there was a caveat with 5548 I2C addresses. My BeagleBone didn't want to work with 5548 chip at the address from its datasheet - 0x34/0x36 (depending on jumper). Luckily Linux has a command to scan I2C buses so my device was found in a couple of minutes (googling):
root@arm:~/py# i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 
I put this address 0x1A into my python script and voila!

So it's time to build an amplifier board.

Sunday, February 2, 2014

PCBs arrived

Oh my! They are gorgeous!
I must think this way because they are my first SMD-PCB-babies. And I have ten of them, so I have enough spare ones if I mess one up.


Right away I found a wrong label: "5431 Amp v.1.0". OK, let's put it this way - "it was made intentionally to confuse enemies".