This is only a preview of the February 2013 issue of Silicon Chip. You can view 19 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "High Performance CLASSiC DAC; Pt.1":
Items relevant to "Do-It-Yourself Seismograph With Tsunami Alarm":
Items relevant to "Mobile Phone Loud Ringer":
Items relevant to "Improved Jacob's Ladder":
Items relevant to "Accurate GPS 1pps Timebase For Frequency Counters":
|
CLASSiC-DAC: a highperformance stereo
digital-to-analog converter
Pt.1: By NICHOLAS VINEN
This high-performance stereo digital-to-analog converter (DAC)
is based on the Cirrus Logic CS4398 as used in Marantz and
other high-fidelity equipment. It has three TOSLINK inputs, three
S/PDIF inputs, a USB audio input and offers playback from an
SD card. As well, it has a built-in headphone amplifier, multiple
status LEDs and fits in a compact low-profile case.
T
HE STEREO DAC project publish
ed in September, October and November 2009 has been a very popular
project. In fact, several SILICON CHIP
staff members subsequently built one
and now use them on a regular basis.
Our new CLASSiC DAC supersedes
that design and employs a better
DAC chip, the Cirrus Logic CS4398,
as used in the Crystal DAC upgrade
(from February 2012). In addition, we
22 Silicon Chip
have added many new features and
obtained performance improvements.
First, the new unit (the CLASSiC
DAC) is more compact than the original DAC at 225 x 165 x 40mm. It requires no mains wiring, being powered
from an AC plugpack, drawing about
1.5W in standby mode and about 2.5W
while running, so it’s considerably
more efficient than the earlier design.
The S/PDIF and TOSLINK inputs
have been increased to three of each.
And the addition of a USB type-B
socket means that you can plug it
straight into a computer or other USB
audio device and play back audio at
up to 48kHz/16-bit without the need
for any additional hardware or drivers.
The addition of a high-quality headphone amplifier means that you can
listen to the audio output. This, in
combination with the ability to play
siliconchip.com.au
back WAV files from SD, SDHC or
SDXC cards (up to 96kHz/24bit!),
means that the CLASSiC DAC can be
used as a self-contained music player.
In response to reader feedback,
we’ve added sampling rate LEDs which
indicate either 44.1kHz, 48kHz, 96kHz
or 192kHz. There are also status LEDs
for each input channel. These show
the active channel and whether data
is present on any of the other inputs.
Like our original DAC, this one also
works with an infrared remote control
but in addition to switching channels
and changing volume, it can also be
used to change tracks/folders when
playing back from an SD card, put the
unit into and out of standby (sleep)
mode and perform other functions
such as panning.
When playing back WAV files from
an SD card, multiple directory levels
are supported. There is also the option of using digital tone controls and
a digital crossfeed circuit for when
headphones are being used; these extra
features work with sampling rates up
to 48kHz.
A redesigned output filter offers
slightly lower distortion than either
of our previous DAC projects. Other
features include click and pop suppression at power-up and powerdown for the headphone amplifier
and configurable gain to suit different
headphone impedances. Automatic
input scanning is also improved from
the earlier design as this unit can sense
the state of its inputs without having
to switch to them.
Operation
Fig.1 shows a block diagram of the
siliconchip.com.au
Features & Specifications
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Three TOSLINK inputs, supporting 32-192kHz/16-24 bit (with appropriate receiver
units)
Three S/PDIF coax inputs, supporting 32-192kHz/16-24 bit
USB audio input, supporting up to 48kHz/16 bit (no drivers required)
SD card playback, supporting up to 96kHz/16-24 bit (MMC/SD/SDHC/SDXC)
Programmable automatic input selection
2V RMS stereo line outputs
Stereo headphone amplifier with volume control and click/pop suppression
Supports 8-600Ω headphones
Digital tone control and DSP headphone cross-feed (with SD card only, up to 48kHz)
Infrared remote control
Powered by 6-9VAC plugpack
~3W operating power, ~1.5W standby
THD+N ~0.001% <at> 1kHz (20Hz-20kHz bandwidth)
Signal-to-noise ratio ~110dB
Frequency response ±0.1dB 20Hz-20kHz
Sampling rate indicator LEDs
Input selection/status LEDs
Standby/input cycle pushbutton & power indicator LED
Fits in slim instrument case (225 x 165 x 40mm) with custom front & rear panels
Most parts mount on a single PCB
CLASSiC DAC. We are using a different digital audio receiver IC compared
to our earlier DAC, a Crystal/Cirrus
Logic CS8416. This is more expensive
than the previously used DIR9001
but has more features which make
the extra cost worthwhile. It has two
internal 8-channel multiplexers and
eight input amplifiers, so we don’t
need external amplifiers for S/PDIF
inputs nor do we need an external
multiplexer to select the active input.
Inputs 1-3 are TOSLINK optical in-
puts which use integrated fibre optic
receiver units and these produce 3.3V
or 5V square-wave outputs which are
fed to three inputs on the CS8416 (IC1).
The USB input is channel 4 and for this
we use a PCM2902 IC (IC2) to do all
the hard work of communicating with
the host computer and implementing
the USB audio protocol. This chip
similarly has a 3.3V full-scale S/PDIF
output which is fed to another of IC1’s
input channels.
The three coaxial S/PDIF inputs
February 2013 23
TOSLINK RX
INPUT
1
LINE
OUTPUTS
TOSLINK RX
L OUT
INPUT
2
DIGITAL AUDIO
RECEIVER
(IC1, CS8416)
TOSLINK RX
INPUT
3
SPI
REF CLK
USB TYPE B
SAMPLING CLOCK
GENERATOR
(IC7, PLL1708
& X2, 27MHz)
S/PDIF (RCA)
INPUT
5
CLOCK
DIVIDE BY 2
(IC8, 74LV74)
S/PDIF (RCA)
SPI
DCI
(Q15, Q16)
HEADPHONE
VOLUME
(VR1)
TOSLINK
Rx POWER
(3.3V OR 5V)
SD/MMC SKT
+15V SW
INPUT
8
MUTING
CON8
IR Rx
S/PDIF (RCA)
R OUT
HEADPHONES
STEREO
HEADPHONE
AMPLIFIER
MICROCONTROLLER
(64-pin dsPIC33,
IC5)
INPUT
6
INPUT
7
MUTING
(Q1, Q2)
SPI
DCI
USB-TO-TOSLINK
CONVERTER
(IC2, PCM2902)
INPUT
4
STEREO DAC
(IC3, CS4398)
DIFFERENTIAL TO
SINGLE-ENDED &
LOW-PASS FILTER
(IC4, LM833)
+3.3V
ELECTRONIC
SWITCHING
(DUAL MOSFETS
Q12, Q13)
–15V SW
SPI
INDICATOR
LEDS
6–9V AC
INPUT
+5V
POWER
SUPPLY
+15V
CON9
–15V
AUDIO SIGNALS:
POWER:
CONTROL SIGNALS:
CLOCKS:
Fig.1: block diagram of the CLASSiC DAC. Its main components are the CS8416 digital audio receiver (IC1), a CS4398
stereo DAC (IC3), a PLL1708 clock generator (IC7) and a dsPIC33 digital signal controller/microcontroller (IC5). The
eight inputs are shown at left, while the line and headphone outputs are at right.
use RCA sockets which are connected
straight into three more of IC1’s input
channels. Coaxial S/PDIF signals can
have quite low amplitude so in this
case, IC1’s internal amplifiers are required to boost the signal level high
enough to allow its decoding circuitry
to handle them.
IC1’s eighth and last input is used to
feed it audio when playing back WAV
files from an SD card. The actual SD
card reading is handled by microcontroller IC5 (a dsPIC33) and this then
converts the WAV audio data to an
S/PDIF stream which it feeds to IC1.
This means that IC5 does not need to
interface with the DAC directly and
avoids the need for additional signal
multiplexing.
Once IC1 has selected and amplified the selected input signal, it then
decodes the S/PDIF data and analyses
it in a number of ways. Its most important task though is to extract the
audio content and output it serially
via an I2S (inter-IC sound) bus which
24 Silicon Chip
is connected to the CS4398 DAC (IC3).
IC3 converts the digital audio stream
to a pair of analog signals which are
fed to a low-pass filter. This converts
the pairs of differential outputs from
IC3 into the more typical single-ended
analog outputs used by most amplifiers
and other pieces of audio gear.
New DAC filter
We have made some changes to the
filtering network in order to improve
its performance. The filter used in
the Crystal DAC design (February
2012), also based on the CS4398 DAC
IC, used the suggested filter from the
Cirrus Logic data sheet but we had
rounded some of the odd component
values (eg, 698Ω) to the nearest E24
series value, such as 680Ω. However
we have subsequently discovered,
via SPICE simulations, that even this
slight shift in component values seriously degrades the ability of the filter
to reject common mode signals.
Obviously, the actual components
won’t have the exact value printed on
them so to some extent any actual filter
is going to deviate from the ideal but
we figure that if the filter can be shown
to work effectively with exact values,
it should at least perform reasonably
well with real components, especially
considering that 1% resistors are often
much closer than 1%. Capacitors are
another matter but 5% MKT types are
not difficult to get and 2.5% or better
are available.
So we again fired up SPICE (“Simulation Program with Integrated Circuit
Emphasis”). Using this software, we
came up with a filter arrangement
that uses only E24-series values for
resistors and E12-series values for
capacitors and provides (in theory at
least) even better common mode signal rejection than the suggested filter
in the data sheet and with a flatter
frequency response, when the whole
circuit is taken into account.
This new filter arrangement is
shown in Fig.2. Fig.3 compares its
siliconchip.com.au
frequency response and CMRR (common mode rejection ratio) to that of the
filter as specified in the Cirrus Logic
data sheet (with the unreal component
values) and the filter with rounded
values, as used in the Crystal DAC.
Note that we have gone back to
using an LM833 dual low noise op
amp rather than discrete component
circuitry for the audio output filters, as
used in the Crystal DAC. This was to
reduce the size and complexity of the
overall circuit as it would otherwise
be over the top.
Muting & output
The CS4398 supports using transistors to mute the outputs when they
are idle or muted, to suppress clicks
and pops. We used this feature in
the Crystal DAC but we decided to
use back-to-back Mosfets rather than
special bipolar junction transistors
as they are easier to get. We are again
using this arrangement, also shown
in Fig.2. However, because we have
designed the DAC to use the CS4398
from the start, this unit has superior
control over the muting FETs and so
suppresses clicks and pops more effectively.
The line outputs of the unit are taken
from the outputs of the DAC filters,
at the point where the muting FETs
connect. These signals are also fed to
the dual-gang volume control pot for
the headphone amplifier.
The headphone amplifier is a currentboosted op amp arrangement, reminiscent of Peter Smith’s November
2005 design although we actually redesigned it from scratch. It’s based on
AmuteC
100k
B
AoutA+
AoutA–
24
SC
3
220 µF
1.5k
2
1
4
750Ω
1.5k
8
IC4a
1.5nF
CLASSIC DAC
A
47 µF
ZD1
18V
D2
G2
–15V
4.7nF
22nF
A
ZD2 18V
100nF
470Ω
6 .8 nF
2013
100Ω
25
23 470Ω
K
100pF
100k
240Ω
AmuteC
Q3
BC559
C
10k
+5V
+15V
E
G1
100Ω
Q1b
S2
S1
D1
K
Q1: Si4804
Q1a
CON6
10nF
–15V
DAC OUTPUT FILTER & MUTING
Fig.2: revised DAC differential low-pass output filter arrangement for the CS4398
IC. The components are arranged in the same manner as for the Crystal DAC
(February 2012) but the values have been changed to provide better common
mode signal rejection and to boost the output voltage level slightly while retaining
a flat frequency response.
another LM833 and while the performance is not quite as good as the discrete HiFi Stereo Headphone Amplifier
circuit published in the September
and October 2011 issues, it is still of a
very high standard and well above that
available from the headphone sockets
of most CD players. Again, this was
done to keep the overall complexity
and size of the unit within reason.
The gain is normally set at unity
(ie, 0dB) using a pair of jumpers and
this suits 8-60Ω headphones, giving an
undistorted power output of around
100mW across this impedance range.
For higher impedance headphones,
12dB of gain can be selected, giving
around 100mW into 600Ω. Lower
impedance headphones can also be
used in combination with this gain
but the result will be slightly more
noise, possibly audible as hiss when
no signal is present, depending upon
the sensitivity of the headphones used.
The output is via a 6.35mm stereo
jack socket and the headphone amplifier is designed to endure a continuous
short circuit, although typically the
output is only shorted briefly when
the headphone jack is inserted or
removed.
A second set of muting FETs are
connected across the headphone outputs, as with the line outputs. This is
designed to prevent the headphone
amplifier output from causing a loud
Why Build This High-Performance DAC?
I
F YOU ALREADY own a DVD player
of average quality or better, you can
hook it up to this DAC and immediately
upgrade the sound quality. Most DVD
players have mediocre audio quality
from their audio outputs, especially in
terms of distortion (see “DVD Players:
How Good Are They For HiFi Audio?” –
SILICON CHIP, October 2007). Some CD
players can also have their performance
improved with the addition of this DAC,
provided of course that the CD player
in question has a TOSLINK or S/PDIF
digital output.
So why are typical DVD players so
poor in audio performance? Partly it is
siliconchip.com.au
L OUT
because they are designed down to a
very low price and while their on-board
DAC might be quite a reasonable component, the supporting circuitry has been
cut to the bone in order to keep the overall
price as low as possible. It is also true
that many cheap (and not so cheap) DVD
players are plagued with quite strong extraneous RF in the audio outputs, mainly
related to the video output signals that
they continuously produce, regardless of
whether they are playing DVDs or CDs.
In addition, virtually all DVD players,
except the most expensive models, use
switchmode power supplies. These have
the advantage of being very efficient and
especially with respect to recent models,
have very low standby power consumption. The drawback of switchmode
power supplies is that they produce lots
of switching harmonics which can get
into the audio outputs.
Finally, because all DVD players these
days are double-insulated and come
with 2-core power cords, they inevitably
cause hum and buzz when connected to
the audio inputs of high-fidelity amplifiers
which are usually earthed via a 3-core
mains cord. There is no simple way to
fix any of these problems but this new
DAC project fixes them all and provides
first-class audio performance.
February 2013 25
+1
80
0
70
-1
60
-2
50
-3
40
-4
-6
-7
10
30
FR (Crystal DAC)
CMRR (Crystal DAC)
FR (Data Sheet)
CMRR (Data Sheet)
FR (CLASSiC DAC)
CMRR (CLASSiC DAC)
-5
20
50
100 200
500
1k
2k
5k
Common Mode Rejection Ratio (dB)
Frequency Response (dBr)
CS4398 DAC Output Filter Comparison
20
10
10k 20k
0
50k 100k
Frequency (Hz)
Fig.3: comparison of the frequency response and common mode rejection
ratio (CMRR) of the various filter arrangements. This includes that of the
Crystal DAC (using standard component values), that from the CS4398
data sheet (using non-realistic component values) and the revised standard
values used in the CLASSiC DAC. The CMRR has been improved by about
18dB <at> 1kHz.
thump in the headphones when power
is applied or removed, due to various
capacitors charging up. This works in
combination with the electronic power
supply switching arrangement, shown
at the bottom of the block diagram.
When power is first applied, the
±15V rails are switched off and it is
these rails that power the op amps in
both the DAC filter and headphone
amplifier, as well as the current-boost
transistors in the latter. This gives the
muting FETs time to switch on first,
after which the ±15V rails are brought
up. Once the amplifier has stabilised,
the FETs are switched off and the
DAC can then be enabled to drive the
headphones.
What Are S/PDIF And Toslink?
The acronym S/PDIF (or SPDIF) stands for Sony/Philips
Digital Interface. Basically, it is a standardised serial interface
for transferring digital audio data between consumer-level equipment such as DVD and CD players, DAT and DVD recorders,
surround-sound decoders and home-theatre amplifiers.
S/PDIF is very similar to the AES3 serial digital interface
used in professional recording and broadcasting environments.
In operation, each digital audio sample (16-24 bits) is packaged
along with status, control and error-checking information into a
32-bit binary word. This is then modulated or encoded into a
serial bitstream using the Biphase Mark Code (BMC).
BMC involves combining the data bits with a clock signal of
twice the data bit rate, in such a way that a binary “1” results in
two polarity reversals in one bit period, while a binary “0” results
in a single polarity reversal. This double bit-rate signal is selfclocking at the receiving end and has no DC component.
The BMC encoded serial bitstream is then transmitted as
a 400mV peak-to-peak signal along a single 75-ohm coaxial
cable. In most cases, the cable connectors used are standard
RCA or “Cinch” connectors, as also used for analog audio and
composite video.
Although originally developed for conveying linear PCM
(LPCM) digital audio signals as used in CD and DAT audio,
26 Silicon Chip
A similar procedure is used during switch-off but in reverse, ie, the
muting FETs are switched on and the
±15V rails are switched off before the
supply collapses entirely.
WAV playback
While we mentioned this capability earlier, here are some more details
on WAV file playback. Note the clock
generation section shown in Fig.1, to
the left of microcontroller IC5. When
reading a WAV file from the SD card,
the micro determines the sampling
rate used from the file header and
must generate a matching clock, both
to time the data transfer to the DAC
IC and also for the DAC IC to use to
reproduce the analog audio.
A PLL1708 audio clock generator
(IC7) is used for this purpose. It uses
a 27MHz crystal and an internal PLL
(phase locked loop) to generate all the
common audio sampling rates, from
16kHz to 96kHz, with nine different
options. It outputs up to four different
clocks which are multiples of these
rates, at 256, 384, 512 or 768 times.
For WAV playback, to generate the
required S/PDIF serial stream to send
to the digital audio receiver, we need
a clock that’s 128 times the sampling
rate. So we take the 256x sampling
rate output from IC7 and divide it by
two using a low-voltage, high-speed
Digital Audio Bitstream Formats
SOURCE
& CODING
SAMPLING
RATE
MAX DATA
BIT RATE
CD-Audio
(LPCM)
44.1kS/s
DVD-Video
& DAT
(LPCM)
DOLBY DIGITAL
(AC-3
COMPRESSED)
96kHz
192kHz
96kS/s
192kS/s
48kS/s
6144kb/s
12.288Mb/s
448kb/s
6144kb/s 12.288Mb/s 24.576Mb/s
896kb/s
48kS/s
2822kb/s 3072kb/s
SPDIF (TOSlink)
5644kb/s
BMC BIT RATE
DVD-Audio
(LPCM)
S/PDIF has also been adapted for conveying compressed digital
audio, including Dolby Digital (AC-3), DTS and MPEG-2 audio.
TOSLINK is essentially just the S/PDIF signal format converted
into the optical domain, for transfer along optical-fibre cables.
The accompanying table (see above) shows the most common
domestic audio bitstream formats and the S/PDIF/TOSLINK
bit rates for each one. Note that LPCM audio is rarely used for
DVD-Video, because even a stereo audio track requires a BMC
bit rate of 6.1Mb/s.
Many current-model DVD players and recorders are provided
with either coaxial S/PDIF or TOSLINK digital audio inputs
and outputs, or quite often a mixture of both. Similarly, many
home-theatre amplifiers are provided with coaxial S/PDIF and/
or TOSLINK inputs. This is also the case with many up-market
PC sound cards.
siliconchip.com.au
The new CLASSiC DAC is built on a single PCB and is much
more compact than our previous Stereo DAC which was built
into a rack-mount case. It also has more inputs and has better
performance.
flipflop (IC8). This is then used to clock
the dsPIC33’s Data Converter Interface
(DCI). The micro selects the clock
speed for the required sampling rate
by sending commands to the PLL1708
using an SPI (Serial Peripheral Interface) bus.
We also send the 256x (undivided)
clock to the CS8416 digital audio receiver (IC1). This is used as a reference
clock, when one of the other seven inputs is selected. The CS8416 contains
circuitry to measure the ratio of the
sampling rate of the incoming audio
stream to the reference clock. Thus,
by setting a known clock rate output
from the PLL1708 and reading the
control registers from the CS8416, the
micro is able to accurately determine
the incoming audio sampling rate and
then displays it using the four LEDs.
Control & user interface
Besides the aforementioned infrared
remote control and headphone volume
control, the only other control input on
the CLASSiC DAC is an illuminated
pushbutton. This can be used to cycle
through the inputs and switch the unit
into and out of standby mode. The
button is brightly illuminated when
the unit is on and dim when the unit
is powered but in standby.
The rear panel carries the power input socket, seven digital audio inputs
and two line outputs. The front panel
has the headphone amplifier volume
control, headphone socket, power
siliconchip.com.au
switch/LED, SD card socket and 12
status LEDs.
Power supply
The power supply for the original
SILICON CHIP DAC was purely linear,
with an 18V-0-18V toroidal transformer, full-wave rectifier, filter capacitors
and linear regulators. This worked
well but was quite inefficient, with the
unit consuming 6-8W and the case lid
above the power supply PCB becoming
slightly warm during operation.
To make the power supply more efficient and to allow the use of a common
type of AC plugpack, the CLASSiC
DAC power supply is a bit more complicated. The ±15V rails are derived
using linear regulators but their input
voltage is boosted using two full-wave
voltage doublers. These rails are also
switched off in standby mode, as the
doubler greatly decreases the supply
efficiency for these rails.
This arrangement means that the
rectified and filtered supply from
which the lower voltage rails (5V &
3.3V) are derived is substantially lower
and so no dropper resistor is required,
with its inherent inefficiency. Also, for
the 3.3V rail, from which substantial
current is drawn during operation (for
the micro and some of the other ICs),
a switch-mode buck pre-regulator is
used, to drop the 10V or so input to
3.9V with high efficiency (90+%).
The 3.9V output of this switchmode
regulator is then regulated to 3.3V
using a linear regulator as the switchmode regulator has relatively poor
ripple rejection and the CS8416 digital
audio receiver IC requires a clean 3.3V
rail for its PLL to operate properly and
provide a low-distortion audio output.
There are also several LC (inductor/
capacitor) filters in the power supply to
further reduce switchmode noise, so it
won’t affect analog audio performance.
Since much less current is required
on the 5V rail, this is derived using a
7805 linear regulator. The TOSLINK
receivers operate from either the 3.3V
or 5V rail, depending on which type
are used, and these draw power while
ever their supply is present. So to save
power during standby, the supply for
these units is also turned off using a
Mosfet.
All linear regulators use the PCB as
a heatsink. Total dissipation is about
3W, spread across about 10 devices
(regulators and ICs), so the copper on
the PCB (and to a lesser extent, the
fibreglass) is more than adequate to
spread and radiate the waste heat. In
operation, the case only gets slightly
warm, directly above the power supply
section (rear left corner).
What’s coming
Next month, we’ll present the full
circuit details for the CLASSiC DAC
and publish several graphs showing
its audio performance. A final article
will then describe the construction,
SC
testing and set-up.
February 2013 27
|