This is only a preview of the May 2013 issue of Silicon Chip. You can view 30 of the 104 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 "DC-DC Converter For the CLASSiC-D Amplifier":
Items relevant to "High-Performance CLASSiC DAC; Pt.4":
Items relevant to "Do Not Disturb Telephone Timer":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
CLASSiC DAC Pt.4
Final article gives the test procedure
and describes how it’s used
By NICHOLAS
N ICHOLAS V
VINEN
INEN
Having described how the new high-performance CLASSiC DAC
works and shown how to build it, it’s now time to set it up & put
it through its paces. We’ll also go into some details about how to
use it, especially the more advanced features.
W
e left off last month having
assembled the CLASSiC DAC
PCBs and connected them together in
the case. Before firing it up, you will
need to program the microcontroller, if
it wasn’t supplied programmed.
Before doing that, it’s a good idea to
do some quick checks to ensure that
the power supply is working and delivering the correct voltages. This will
avoid damaging the ICs when power is
applied to the rest of the circuit.
Test procedure
Before applying power, check that:
IC4 and IC6 are out of their sockets;
JP1 is not fitted;
JP2 and JP3 are fitted in the 0dB
positions;
• VR1, VR2 and VR3 are rotated fully
anti-clockwise;
• LK1 and LK2 (closely-spaced pairs
of pads labelled in red on the overlay
diagram) are clear of solder;
• All the DIP switches are off;
•
•
•
siliconchip.com.au
•
Your DMM is set to measure DC
volts; and
• You have the PCB orientated as
shown in the overlay diagram last
month, with the connectors at left, so
that you can easily follow the instructions below
With a DMM at the ready, connect a
9VAC plugpack and switch it on, then
measure the output of REG3 (bottommost pin) using its tab mounting
screw as the ground reference point.
You should get a reading of around
5V (4.8-5.2V). If not, switch off and
check for faults.
Also measure the output of REG5,
the 4-pin SMD to the left of bobbin
inductor L6; use the same ground
reference point as before and carefully
probe its top-most pin. You should get
a reading very close to 3.3V. If this is
not between 3.2V and 3.4V, switch
off and check the board carefully,
especially in the power supply (lower
left) area.
Assuming it’s OK so far, check the
±15V outputs from REG1 and REG2.
Like REG3, their outputs are the
bottom-most pin and for REG1, this
should read around 15V (14.5-15.5V
say). When checking REG2, be aware
that you can’t use its mounting screw
as a ground reference since that is
actually connected to the regulator
input. You should get a negative voltage in a similar range as that indicated
for REG1.
Finally, check the input to REG5, ie,
its bottom-most pin (we measured its
3.3V output earlier). You should get
a reading just below 4V. If it’s much
higher than that, it could be that REG4
is not operating correctly and this
would lead to REG5 overheating during operation so switch off and check
for faults around REG4. If you get the
correct reading, switch off anyway as
the power supply tests are finished.
At this point we should say that
when we ran through these tests for
May 2013 57
Setting Up The Remote Control
A universal remote control can be
used to control the DAC and is virtually
mandatory if you will be using the SD
card playback capability. Before the
remote can be used, it must be set to
send out the right codes.
For the Altronics/Dynalink A1012
remote, put it in TV mode and use code
156. To do this, press “TV” while holding
down the “Set” button, then enter 156 on
the keypad. If this conflicts with other
equipment you own, slide DIP switch
#3 on the PCB to its on position, then
set the remote to TV code 170 instead.
For the Jaycar/Digitech AR-1726 re-
our prototypes, in two cases the 7915’s
(REG2) output was much higher than
expected at around -20V. This was
fixed by replacing the regulator with
an On Semiconductor branded unit
which we got at our local parts shop.
We think that the batch of 7915s we
had in stock were dodgy but it’s possible that this is a widespread problem
with certain brands of regulator under
these conditions (input voltage close
to maximum, output current draw
low). While the -20V would probably
have dropped quickly once a load
was applied, rather than risk damage
to the op amps, we elected to replace
the regulator and suggest you do the
same if this happens to you.
Making repairs
If you do have to de-solder a component to replace it, be careful as the
plated-through holes really hold onto
the pins well and you don’t want to
damage the PCB.
For TO-220 package parts like
REG2, the best method is to remove
the screw, bend the tab up to vertical,
hold the tab with pliers and heat all
three pads simultaneously (add solder
if necessary) while gently pulling the
part away from the board. If it doesn’t
come out a few seconds after all the
solder has melted, wiggle the tab from
side-to-side. If it still won’t come out,
let it cool down and try again later, to
avoid lifting any pads from excessive
heat application.
Smaller components can be removed using a similar technique
although it’s usually easier to cut one
or more of the leads off first, remove
58 Silicon Chip
mote, use code 252. To enter this code,
hold down the mode button you want to
assign (TV, VCR, AUX, etc – it doesn’t
matter which) for a few seconds. Then
enter the code, 252, press OK and after
a couple of seconds, press the mode
button again.
If for some reason this doesn’t work
for you and you want an alternative,
change the position of DIP switch #3 to
on and use code 281.
Verify that the remote is working by
changing inputs with the numeric buttons 1-8. You should also be able to turn
the DAC on and off (into/out of standby
the body of the component and then
de-solder the leads individually. A
solder sucker can then be used to clear
the holes so that a new component
can be fitted.
Next steps
Now short both LK1 and LK2 with
solder. Be careful not to touch any adjacent components with the soldering
iron. You may have to try a few times
before you manage to successfully
bridge the pads since they are quite
small.
Use a DMM to check that there is
continuity between the output pin of
REG3 (bottom) and the lower pin of
JP1. Check also for continuity between
the top-most pin of REG5 and the upper pin of JP1.
Now plug IC4 and IC6 into their
sockets, checking the required orientation carefully (they’re different). If you
haven’t already connected the main
board to the front panel with the two
cables made earlier, do so now. Slide
the top-most DIP switch (Power On)
to the On position and fit a shunt on
JP1 in the appropriate position. Most
TOSLINK receivers will operate from
3.3V these days but it’s best to check
with the supplier if unsure.
Programming the micro
If you built the DAC from a kit or
are using one of our pre-programmed
microcontrollers, it should be ready
to go. If not, you will need to plug a
pin header into CON11’s pads on the
PCB; it should be a tight fit and will be
held in by friction. Connect a PICkit3
or similar in-circuit programmer and
The unit
will work with
most universal
remotes including the
Altronics A1012.
mode) using the power button and
change the volume using the volume
up/down buttons. The power switch LED
will flash to acknowledge the reception
of infrared commands.
flash IC5. The HEX file is available
from the SILICON CHIP website.
You can use the PICkit3 to supply
3.3V for the microcontroller while
flashing. We have confirmed that this
works OK. But if that isn’t possible
for some reason, you can connect the
plugpack instead.
Once MPLAB is configured for the
correct device (dsPIC33FJ128GP306),
the ICSP is connected and power is
applied. The chip should then be
recognised and its revision number
shown. If not, switch off and check for
faults, especially in IC5’s solder joints.
You may also find, as we did on one
of our prototypes, that the friction-fit
header makes marginal contact and
you have to put pressure on it to get a
reliable connection. In this case you
can simply solder the ICSP header
(CON11) to the PCB.
Once the chip has been programmed,
you should get a message that it was
successfully verified. You can then
switch off, disconnect the programmer and unplug CON11, assuming you
haven’t soldered the latter in place.
Checking the LEDs
With power applied, confirm that
the power LED and the Input 1 LED
light up. A brief press of the power button should cycle through the available
inputs and let you check that all eight
input LEDs are working OK and have
a reasonably similar brightness level.
Because we’re running the blue
LEDs at a low current (to avoid frying
your eyeballs in a dimly lit room), you
may find that there are some “duds”.
We had a few of these in the batch of
siliconchip.com.au
LEDs we bought and ended up replacing several on the PCB. If you measure
the resistance between anode and
cathode, you will probably find any
duds will measure below 1kΩ in one
or both directions. This shunt resistance is a manufacturing fault; the LEDs
probably work OK at higher currents so
you can use them for something else.
Even if you don’t have any duds, the
LED brightness might be uneven. We
have tried to compensate for the different efficiency of green, blue, yellow
and red LEDs by varying the current
limiting resistors but your LEDs may
have a different brightness/efficiency
than ours.
This won’t usually matter but if
they vary wildly, you may want to
shunt some of the limiting resistors
or possibly even replace them to get
a more even display; not that it’s all
that critical as they are normally only
lit up one at a time.
Setting quiescent current & gain
Now set up the headphone amplifier. Measure the voltage across the
top-most 22Ω emitter resistor in the
upper-right corner of the board, next to
ZD7. There are a pair of adjacent pads
connected in parallel with this resistor
that you can use to connect the probes.
You should get a very low reading, ie, just a few millivolts. Now
slowly turn VR2 clockwise until you
get a reading of 0.1V. This should be
with VR2 rotated roughly half-way
through its full travel. Then measure
the voltage across one of the other
22Ω resistors immediately behind the
headphone jack socket and adjust VR3
to get the same reading.
If you are planning to use high
impedance headphones (>60Ω) then
you will probably want to set the
headphone output gain to +12dB.
To do this, move JP2 and JP3 to their
alternative positions.
Final testing & set-up
The final test is to check that the
sound output is working correctly.
This is done most easily with a WAV
file loaded on an SD card although
there are other methods (see below).
Load a WAV file copied from a CD
(ie, 44.1kHz 16-bit stereo) onto a blank
SD card and plug it in to the DAC. Connect headphones (using a 3.5mm to
6.5mm adaptor if necessary) and turn
the volume down close to minimum.
If you don’t have headphones, you
siliconchip.com.au
Fig.14: when the DAC is connected to a computer’s USB port, it will be detected
regardless of whether the DAC itself has power. This shows how it appears in
Device Manager under Windows 7 – as “USB Audio CODEC” under “Sound,
video and game controllers”. You can check that it is the default output device
in the Sound control panel and if not, make it the default.
can hook up an amplifier to the line
outputs instead.
Power up and check that LED8
(red) turns on, dimly at first and then
brighter once the SD card has been
initialised. If you now slowly turn up
the volume, you should hear the file
being played back. Check that it is in
stereo and distortion-free.
If LED8 doesn’t light or stays dim,
check the soldering on the SD card
socket and the microcontroller. It
could also be a problem with the components behind the SD card socket.
There’s also a possibility that the
WAV file format is incorrect; while
the DAC will play most WAV files
with a supported sampling rate, bit
depth and number of channels, the
WAV format allows for quite a bit of
variation and some files may not be
properly recognised. So it might help
to reformat the SD card and load a
different WAV file on.
If that went well, it shows that a
large portion of the circuit is working
correctly. If you can’t get the file to
play from the SD card though, or you
don’t have a suitable card, try one of
the following methods to help narrow
down the problem.
into a computer using an appropriate
cable (Type A to Type B). It should be
recognised and a new audio interface
should appear (the DAC’s USB interface runs off the computer’s power
supply). Fig.14 shows how the device
shows up in Windows 7 Device Manager (as “USB Audio CODEC”) and in
the Sound settings in the Control Panel.
In most cases, your computer will
automatically select the USB audio
device as the currently active sound
output. If it doesn’t, you will then
have to make it the current output
device. Once you’ve verified that it is
active, switch the DAC power on and
play some audio from the computer.
It should sound clear and undistorted.
If the SD card output works but
USB audio doesn’t, check the circuitry
around IC2. The most likely symptom
if there is a fault in this circuitry is
that the USB Audio CODEC will not
be detected by your computer. Alternatively, if USB audio works but
playback from the SD card doesn’t,
this suggests either the DAC doesn’t
recognise the file format or there is
a problem in the circuitry associated
with the SD card.
Testing the USB interface
Finally, if you have a TOSLINK or
S/PDIF digital audio source, check
Power down the DAC and plug it
Testing the other inputs
May 2013 59
Equal Loudness Curves
ISO 226:2003
120
100
10dB
80 phon
80
60 phon
18dB
60
20dB
20 phon
40
40
20 phon
20
0 phon (threshold)
0
20
50
that the other inputs are working
correctly. The associated input LED
should light up dimly when a signal
source is plugged into each input and
you can then use brief presses of the
power button to cycle the current input
until the one being tested is selected.
You can then check that the audio
output is clean.
Having tested that all the inputs are
working (or at least, those which you
can) and that the headphone output is
OK, that verifies that virtually all the
circuit is operating correctly.
Setting the DIP switches
The “Setting Up The Remote Control” panel (page 58) discusses the use
of DIP switch #3 to select the alternative set of remote control commands.
DIP switch #1 determines whether the
unit switches on initially when power
is applied; if set to off, the DAC will
start up in standby mode and must be
switched on before use by pressing the
power button on the unit itself or on
the remote control.
If the second DIP switch is left
off, the unit will only change inputs
automatically when an SD card is
inserted or when the unit is plugged
into a computer via USB. In both these
cases, it automatically switches to the
relevant input. With DIP switch #2 on,
however, it will also switch to another
input if a valid signal appears on that
input and either there is no signal on
the current input or there has been
no audio on the current input for at
60 Silicon Chip
(estimated)
Fletcher-Munson
100 phon
Sound Pressure Level (dB SPL)
Fig.15: each red
line plots the sound
pressure level
required to give
sounds that appear to
have equal loudness
over the range of
audible frequencies,
from 20Hz up to
nearly 20kHz. The
lines are plotted for 0,
20, 40, 60, 80 and 100
phon where 1 phon
= 1 dB SPL at 1kHz.
The auto-loudness
feature compensates
for the ear’s loss
in sensitivity at
low frequencies
by progressively
boosting the bass as
the volume level is
reduced (see text).
100 200
500 1k 2k
Frequency (Hz)
5k
10k 20k
least 10 seconds (this time period can
be changed via the configuration file;
see below).
Finally, the fourth DIP switch controls whether the power LED is lit
dimly when the unit is in standby (on)
or not lit at all (off).
Using the DAC
At this stage, if you just want to use
the unit as a plain DAC, you should
be ready to go. When on, it can be
switched into standby by holding the
power button down for a second or
so, or by pressing the on/off button
on the remote control. A brief press of
the power button switches it back on.
The current input can be changed by
further presses on the power button
or via the numeric buttons 1-8 on the
remote control.
The mute button on the remote control can be used to temporarily mute
the output while the volume buttons
will change the volume digitally. However for best quality, leave the digital
volume at or near maximum and
adjust the volume on the headphone
volume pot or, when using an external
amplifier, with that amplifier’s volume
control.
Most of the remaining controls are
useful mainly when playing back
WAV files from an SD card, ie, when
using the CLASSiC DAC as a music or
audio player.
SD card playback
If you have more than a few audio
files on an SD card, then typically
these should be arranged in folders
(aka directories). For example, if playing music, you could have one folder
for each musician, with another set of
folders within these for each album
or disc. The WAV files would then be
within these folders.
Alternatively, you could simply
have one folder in the root directory
for each disc, with its name prefixed
by the artist/performer. Both schemes
will give a similar result.
If you want the tracks to play back
in the same order as they are on the CD
then the usual practice is to prefix each
track with its number, padded out to
two digits. For example, the first could
be named “01 – Track One.wav” or
“01 Track One.wav”. That way, when
sorting the file names alphabetically
(which is the default), they will be
played in the correct order.
With a card inserted, use the left and
right arrows on the remote control to
skip between tracks within a folder.
Skipping past the beginning or end
will initiate playback from the previous/next folder. Similarly, if you press
the left arrow when playing the first
track of the first folder it will “wrap
around” to play the last track of the
last folder. Conversely, if you press the
right arrow on this last track, it will
wrap in the other direction.
The down arrow will skip to the
first file in the next folder regardless
of which track is being played from
the current folder and similarly, the
up arrow will go to the first file in
the previous folder. This is roughly
equivalent to “next/previous disc”
with a CD changer.
So with either of the folder schemes
mentioned above, the up and down
arrows will move between the discs
from a given artist or performer and
if you continue pressing these keys,
you will switch to the (alphabetically)
next/previous artist.
Navigating the tracks
While there’s no display to show
you which track is currently being
played (ie, you’re navigating “blind”),
if you have a list of the folders on the
card then it is usually a fairly simple
matter to navigate to the one that you
wish to use.
For reference, a 16GB SD card will
fit around 23 full CDs worth of WAV
files, a 32GB card 45 CDs and a 64GB
card at least 91 CDs worth. In practice
siliconchip.com.au
you will fit more since CDs are rarely
full (ie, the track total is usually less
than 80 minutes).
Button
Function
Changing file order
Power
Enter/leave standby
It’s also possible to play tracks from
the card in a different order. If you
press the “OK” button on the remote
then the playback order changes from
alphabetically sorted to shuffled. Then
when you change to the next/previous
track, it will jump to a random track
in the current folder.
The order of folders is also shuffled,
so pressing the up/down arrows will
go to a random folder within the current nesting level.
Pressing the OK button again then
changes the playback order so that the
tracks play in the order that they are
stored on the SD card. This will tend
to be the order in which you loaded
the folders and files onto it, although
that isn’t guaranteed. A third press of
the OK button returns to the original
alphabetical sort.
Mute
Turn mute on or off
1-8
Switch to input 1-8
Pause
(WAV) Pause/resume
Rewind/Fast forward
(WAV) Skip back/forward 10 seconds
Play/Stop
(WAV) Start/stop playback
TV/Video (A1012) / Menu (AR1726)
Go to control mode 1 (normal)
Teletext (A1012) / TV/VCR (AR1726)
Go to control mode 2 (tone controls)
Page hold (A1012) / TV/AV (AR1726)
Go to control mode 3 (crossfeed control)
Tone controls
The digital tone controls (bass/treble
boost/cut) operate only when playing
back WAV files from an SD card. This
is because we wanted to avoid having
audio pass through the microcontroller
if it wasn’t necessary, as the sound
quality could potentially be affected
even though it is digitally transmitted (eg, due to added jitter). However,
since the microcontroller is in charge
of WAV playback anyway, we have
taken advantage of the ability to do
some extra processing.
Table 1: Remote Control Buttons With Same Function In All Modes
This feature is limited to sampling
rates of 48kHz and below because
the microcontroller simply isn’t fast
enough to play back higher sampling
rate WAV files and process them too.
It’s automatically disabled at higher
sampling rates.
You can boost or cut the treble or
bass by a few decibels. Since this is
done digitally, it has relatively little
impact on sound quality although
there is inevitably some loss in dynamic range.
By default, the bass boost/cut is affected with a first-order low-pass filter
that has a corner frequency of 500Hz.
Similarly, treble boost/cut uses a firstorder high-pass filter with a -3dB point
of 2kHz. You can adjust these frequencies within a limited range although
there’s little benefit in doing so. Briefly,
to use the tone controls:
• Press the “teletext”* (A1012) or TV/
VCR (AR1726) button to enter control
mode 2 (* = see Table 1).
• Press the record button to enable
the tone controls.
• Use the up/down/left/right buttons
to adjust treble and bass levels. Note
that with the AR1726 remote, these
may not automatically repeat when
held down.
• If necessary, use the volume up/
down and channel up/down buttons
to adjust the corner frequencies.
• Press the TV/Video (A1012) or
Menu (AR1726) button to switch the
remote functions back to default.
Note that as you adjust the tone
controls, the volume automatically
changes to avoid clipping the audio
signal. This interferes with the ability to compare the sound with and
without tone controls so you can press
the 0 (zero) button while in control
mode 2 to reduce the audio volume
Digital Tone Control Implementation
As described in the main text, the
CLASSiC DAC can provide digital tone
controls when playing back WAV files.
This involves manipulating the digital
audio data after it has been read off
the SD card and before it is send out as
an S/PDIF stream to eventually reach
the DAC IC.
To do this, we are using a digital signal
processing (DSP) technique known as
an Infinite Impulse Response (IIR) filter.
This is effectively a digital version of the
analog RC low-pass/high-pass filter
although IIR can also be used to build
the digital equivalent of more complex
filters too.
The name “infinite impulse response”
siliconchip.com.au
comes from the fact that with an IIR
filter of sufficient precision, a transient
(impulse) will have an exponentially
decaying effect on the output of the filter
that never quite ends although practical
limits of numeric precision mean that
its influence will eventually reach zero.
This is as opposed to Finite Impulse Response (FIR) filters which have a defined
“window” so each impulse only affects a
limited number of audio samples before/
after that impulse.
The only numerically intensive part of
implementing an IIR filter is calculating
the filter coefficients, which can be done
once for a given combination of corner
frequency, sampling rate and gain. The
CLASSiC DAC firmware does these calculations using floating point arithmetic.
This is slow but because it’s only done
when the filter or sampling rate changes,
that doesn’t matter.
During playback, each IIR filter only
requires a few integer multiplication
operations (2-3) and a summation per
audio sample.
For more information on how to build a
simple digital IIR filter, see the following
page: http://freeverb3.sourceforge.
net/iir_filter.shtml
The low-pass filter in the crossfeed
routine also uses an IIR algorithm but
this is combined with a small delay buffer
in order to create the desired effect.
May 2013 61
Table 2: Mode-Specific Remote Control Buttons
Button
Function In Control Mode 1
Function In Control Mode 2
Function In Control Mode 3
ChUp/ChDn
Pan left/right
Change bass -3dB frequency
Change crossfeed attenuation
VolUp/VolDn
Change volume
Change treble -3dB frequency
Change volume
Left/right arrow
Previous/next WAV file
Change treble gain
Change crossfeed LPF frequency
Up/down arrow
Previous/next WAV folder
Change bass gain
Change crossfeed delay
OK
Change playback order
Reset tone controls
Reset crossfeed settings
Record
Pan to centre
Toggle enable tone controls
Toggle enable crossfeed
0
-
Tone control equal volume mode
-
9
-
Enable auto-loudness
-
regardless of the tone control settings.
You can then use the record button to
toggle the tone controls on and off for
an A/B comparison.
Note that you will probably need
to increase the headphone/amplifier
volume in this mode. Pressing zero
again toggles it off (and increases the
volume again), which you should do
when you’re finished as this gives better audio quality.
Auto-loudness
You may have noticed that music
normally sounds better when it’s loud.
It’s because the human ear’s frequency
response is different at different sound
levels. As you lower the volume of the
music, keeping its frequency distribution even, the bass (and to a lesser
extent, the treble) seem to “drop out”.
The result is that the music sounds
“thin” at lower volume levels.
To see why this is, have a look at
the accompanying graph, Fig.15. This
shows both the original equal-loudness
curves (“Fletcher-Munson”) and the
more up-to-date and accurate ISO
226-2003 curves (reproduced from
Wikipedia).
Consider the red line showing the
60 phon level (a measure of apparent
loudness). At 1kHz, the sound level
must drop 20dB for an apparent reduction in loudness of 20 phon. But if you
follow the red 60 phon line down to
30Hz, the drop to the 40 phon level is
just 10dB (from 100dB SPL to 90dB
SPL).
Hence a drop of 20dB at 30Hz reduces the apparent sound level by
about 40dB. By boosting bass at lower
volumes, we can compensate for this.
The CLASSiC DAC’s auto-loudness
feature does just this; it also boosts
treble at low volumes but less so than
bass. Some old amplifiers had this
62 Silicon Chip
type of feature (in analog, naturally)
but it is now rare. We found that the
DAC implementation of loudness
compensation works quite well and
greatly increases listening enjoyment
at low volume levels.
This feature works by taking over
the tone controls and adjusting them
automatically as the digital volume
level is adjusted. As such, it has the
same restrictions outlined above. In
control mode 2, enable the tone controls and then press the 9 button on
the remote to enable this mode. Making any tone adjustment immediately
disables it.
With auto-loudness enabled, switch
back to control mode 1 as described
above and turn the volume down to
hear the effect.
Crossfeed
This is a feature for headphone users.
You may have noticed that headphones
can sound unnatural, especially in
recordings with wide stereo separation – the sound you are listening to
can appear to come from inside your
head and move around inside it!
This is because the headphones
effectively provide totally separate
sounds to each ear but normally, you
can hear a sound in both ears even
if it’s coming from one side of your
head. The sound waves still make it
to the other ear, although attenuated.
Crossfeed simulates this by delaying
the sound for each channel, attenuating it, applying a low-pass filter and
then feeding it across to the other ear
(ie, “crossfeed”).
The effect of the crossfeed feature
is quite subtle but can be enough to
remove the unnerving aspects of the
stereo signal. As with the tone controls
and auto-loudness, this only applies to
WAV file playback at sampling rates up
to 48kHz. To turn it on, press the “page
hold”* (A1012) or TV/AV (AR1726)
button and then press the OSD button.
Another press of this button turns it
back off so you can compare the sound
with and without crossfeed (* = see
Table 1).
Note though that the sound volume
will drop slightly with it on, for the
same reason as this happens with
tone controls – ie, to avoid the signal
clipping. You can combine crossfeed
and auto-loudness or tone controls, if
you wish.
The various parameters for this
mode can be adjusted but the defaults
chosen should work well for most
people (see the list of remote control
commands for the list of parameters
that can be changed). Pressing the
OK button while in control mode 3
will reset these changes while the TV/
Video or Menu button can be used
to get back to normal remote control
mode as explained earlier (crossfeed
will stay on if enabled).
Since crossfeed is only really useful
when using headphones, it is automatically disabled if there is nothing
plugged into the headphone socket.
You can override this in the configuration file though (eg, if using an external
headphone amplifier) – see below.
More remote control commands
Tables 1 and 2 show all the remote
control commands. Many of these
have already been explained. Note that
some buttons change function depending on the current control mode; the
DAC starts in control mode 1 but you
can then switch it to 2 and 3 using the
buttons indicated.
Some of the buttons on the A1012
remote are labelled with pictograms
which many people won’t recognise
so we have put small images of these
siliconchip.com.au
Table 3: Standard Settings
Setting Name
Possible Values
Input
1, 2, 3, 4, 5, 6, 7, 8
Mute
true, false
Volume
0 to 255 (1 = -0.5dB, 2 = -1dB, 3 = -1.5dB etc; default = 0)
Balance
-20 to 20 (-20 = fully left, default = 0)
Init_File
<name of file to play first when card is inserted>
PlaybackOrder
sorted, directory, shuffle
Auto_Play
true or false (default = true)
Auto_Switch_Enabled
false, true (overrides DIP switch 2)
Auto_Switch_Delay
1-999 (seconds; default = 10)
AlternativeIRCodes
false, true (overrides DIP switch 3)
Tone_Enabled
false, true
Tone_EqualVolume
false, true
Tone_AutoLoudness
false, true
Tone_BassBoostCut
-16 to 16 (-16 = full cut, 16 = full boost)
Tone_BassCrossoverFreq
50 to 950 (in Hz; default = 500)
Tone_TrebleBoostCut
-16 to 16 (-16 = full cut, 16 = full boost)
Tone_TrebleCrossoverFreq
1000 to 5000 (in Hz; default = 2000)
Crossfeed_Enabled
false, true
Crossfeed_LPFFreq
50 to 5000 (in Hz; default = 1500)
Crossfeed_Delay
1 to 32 (in samples; default = 14 for about 0.5ms)
Crossfeed_Atten
1 to 5 (effect is halved as number increases; default = 3)
Table 4: Variable Extra Settings (All Are True/False; Default = False)
Setting
Function
StereoSwap
Swaps left & right audio channels
DownmixToMono
If true, output is a mono mix of left & right channels
Filter_Slowrolloff
Selects alternative DAC output filter (not recommended)
InvertPolarity
If true, output phase is inverted
NoFreeRunningPLL
If true, DAC runs at 44.1kHz when there is no valid digital
signal
NoDeEmphasis
False, true (if true, disable de-emphasis support)
Crossfeed_IgnoreHPSocket
If true, crossfeed is not disabled when headphones not
plugged in
alongside the names, to make them
easier to pick out.
Settings memory
Virtually all of the settings which
can be changed with the remote control are “remembered” by the DAC
when it is put into standby and even
if it is powered off. This includes not
only volume, tone control, crossfeed
state etc but also which WAV file is being played, the position in the file and
siliconchip.com.au
so on. As long as you put the unit into
standby before switching the power
off, when you switch it back on, you
will be right back where you were.
The circuit incorporates some components so that if power is lost while
the unit is running, it will attempt to
save the current settings. However,
the power supply capacitors collapse
relatively quickly so it may not always
have time to do so. Hence it’s always
a good idea to go into standby before
switching the unit off at the wall.
Some settings can also be changed
by putting a configuration file on the
SD card (see below). These are loaded
at power-on or when the card is inserted and if present, will override
whatever the current settings are.
Configuration file
The configuration file is an optional
text file placed in the root directory of
the SD card, named “DAC.cfg”. It has
one setting per line, with the setting
name on the left followed by an equals
sign (=) and then the value on the right.
Tables 3 and 4 show all the possible
settings. Settings not listed in the file
will not be changed. Here is a sample
configuration file:
Auto_Play = true
Init_File = \My Music\01 – First Track.wav
Tone_Enabled = true
Tone_AutoLoudness = true
Crossfeed_Enabled = true
Crossfeed_IgnoreHPSocket = false
Bootloader
Should you need to update the microcontroller firmware, eg, if a bugfix
becomes available, this can be done
from the SD card without the need for
a programmer or even to open the case
up. First, rename the new firmware
file to DAC.HEX and place it the root
directory of an SD card. Then, with the
DAC off, insert the card in the socket
and power the unit up.
The sampling rate LEDs will start a
chaser pattern while it checks the HEX
file against the existing firmware. If it’s
different, the unit will re-flash itself,
using the eight input channel LEDs as
a bargraph to indicate progress. Once
programming is complete, the unit will
boot into the new software and you can
then remove the SD card and delete
the file from it (it’s no longer needed).
This “bootloader” function is
particularly useful if you bought a
pre-programmed chip and don’t have
a PICkit to reprogram it later if new
software is made available.
That completes the description of
how to operate the CLASSiC DAC.
As is typical for our projects, the full
software source code (around 9000
lines of C) is available for download
from our website in a zip file. We will
also supply a small document with
an overview of the software and a
brief explanation of how some of its
SC
parts work.
May 2013 63
|