Silicon ChipHigh-Quality Stereo Digital-To-Analog Converter, Pt.1 - September 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Low sunspot activity presages solar cooling
  4. Project: High-Quality Stereo Digital-To-Analog Converter, Pt.1 by Nicholas Vinen
  5. Project: Using A Wideband O₂ Sensor In Your Car, Pt.1 by John Clarke
  6. Feature: Introducing OLED Displays by Mauro Grassi
  7. Review: At Last . . . An Affordable Logic Analyser by Geoff Graham
  8. Feature: Pebble: PICAXE Electronic Bread Board Layout Emulator by Wayne Geary
  9. Project: Build A Simple Seismograph On A Protoboard by Stan Swan
  10. Project: Autodim Add-On For The 6-Digit GPS Clock by Jim Rowe
  11. Project: 3-Channel UHF Rolling-Code Remote Control, Pt.2 by John Clarke
  12. Vintage Radio: The Kellogg TRF receiver by Rodney Champness
  13. Book Store
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the September 2009 issue of Silicon Chip.

You can view 33 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 "High-Quality Stereo Digital-To-Analog Converter, Pt.1":
  • 4-Output Universal Regulator PCB [18105151] (AUD $5.00)
  • High-Quality Stereo DAC Input PCB [01109091] (AUD $10.00)
  • High-Quality Stereo DAC main PCB [01109092] (AUD $10.00)
  • High-Quality Stereo DAC front panel PCB [01109093] (AUD $7.50)
  • ATmega48 programmed for the Stereo DAC [0110909A.HEX] (Programmed Microcontroller, AUD $15.00)
  • ATmega48 firmware and C source code for the Stereo DAC [0110909A.HEX] (Software, Free)
  • Stereo DAC Digital/Control board PCB pattern (PDF download) [01109091] (Free)
  • Stereo DAC Analog board PCB pattern (PDF download) [01109092] (Free)
  • Stereo DAC Switch board PCB pattern (PDF download) [01109093] (Free)
Articles in this series:
  • High-Quality Stereo Digital-To-Analog Converter, Pt.1 (September 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.1 (September 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.2 (October 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.2 (October 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.3 (November 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.3 (November 2009)
  • A Balanced Output Board for the Stereo DAC (January 2010)
  • A Balanced Output Board for the Stereo DAC (January 2010)
Items relevant to "Using A Wideband O₂ Sensor In Your Car, Pt.1":
  • PIC16F88-I/P programmed for the Wideband Oxygen Sensor Controller [0511009A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Wideband Oxygen Sensor Controller [0511009A.HEX] (Software, Free)
  • Wideband Oxygen Sensor Controller PCB pattern (PDF download) [05110091] (Free)
Articles in this series:
  • Using A Wideband O₂ Sensor In Your Car, Pt.1 (September 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.1 (September 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.2 (October 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.2 (October 2009)
Items relevant to "Autodim Add-On For The 6-Digit GPS Clock":
  • 6-Digit GPS Clock Autodim Add-On PCB [04208091] (AUD $5.00)
  • 6-Digit GPS Clock Driver PCB [07106091] (AUD $15.00)
  • 6-Digit GPS Clock Main PCB [04105091] (AUD $25.00)
  • PIC16F877A-I/P programmed for the 6-Digit GPS Clock [0410509E.HEX] (Programmed Microcontroller, AUD $20.00)
  • PIC16F877A firmware and source code for the 6-digit GPS Clock [0410509E.HEX] (Software, Free)
  • 6-Digit GPS Clock Autodim Add-On PCB pattern (PDF download) [04208091] (Free)
Items relevant to "3-Channel UHF Rolling-Code Remote Control, Pt.2":
  • PIC16F88-I/P programmed for the 3-Channel Rolling Code UHF Remote Control Transmitter [1500809A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88-I/P programmed for the 3-Channel Rolling Code UHF Remote Control Receiver [1500809B.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the 3-Channel UHF Rolling Code Remote Control [1500809A/B.HEX] (Software, Free)
  • 3-Channel UHF Rolling Code Remote Control Transmitter PCB pattern (PDF download) [15008091] (Free)
  • 3-Channel UHF Rolling Code Remote Control Receiver PCB pattern (PDF download) [15008092] (Free)
  • 3-Channel UHF Rolling Code Remote Control Receiver front panel artwork (PDF download) (Free)
  • 3-Channel UHF Rolling Code Remote Control Transmitter front panel artwork (PDF download) (Free)
Articles in this series:
  • A 3-Channel UHF Rolling-Code Remote Control, Pt.1 (August 2009)
  • A 3-Channel UHF Rolling-Code Remote Control, Pt.1 (August 2009)
  • 3-Channel UHF Rolling-Code Remote Control, Pt.2 (September 2009)
  • 3-Channel UHF Rolling-Code Remote Control, Pt.2 (September 2009)

Purchase a printed copy of this issue for $10.00.

Ver s a t ile de si gn acc ep t s Are you listening to CDs via your DVD player? Does your DVD player have average sound quality or worse, cause buzz and hum problems when hooked up to your hifi system? Either way, you need this high-quality Stereo Digital-To-Analog Converter (DAC) to get first class sound and zero hum. T HIS 24-BIT, 96kHz-capable stereo DAC provides sound quality equal to the best high-end CD players, regardless of price. It has one coaxial S/PDIF input and two TOSLINK (optical) inputs, to which you can connect a DVD player, set-top box, DVR, computer or any other source of linear PCM digital audio. It also has left and right RCA sockets for connection to a stereo amplifier or home theatre receiver. If you already own a DVD player of average quality or better, you can hook it up to this DAC and immediately 12  Silicon Chip 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). So why are typical DVD players so poor in audio performance? Partly it is because they are designed down to a very low price and while their onboard 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 pos- sible. 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 siliconchip.com.au Build a high-quality stereo DAC for superb sound from your DVD player Pt.1: Design by NICHOLAS VINEN bo t h op t ic al & c oa x i a l in p u t s of switchmode power supplies is that they produce lots of switching harmonics which can also 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 highfidelity 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 to boot. valid signal on one of its three digital inputs and when one is detected, it immediately locks onto it and works. Alternatively, you can select the wanted input signal by pressing the relevant button or you can do it with a Philips RC5-compatible remote control (such as most universal remotes) which can also be used to control the volume from the left and right outputs. As previously stated, the unit accepts both TOSLINK (optical) and coaxial (S/PDIF) inputs, while a pair of RCA sockets are used for the left and right stereo outputs. Main features User interface Our prototype DAC is housed in a one-unit high rack-mount case. The front-panel controls are just an on/ off switch and three LED-illuminated momentary pushbuttons. In operation, the DAC scans for a The user interface provides two functions – display of the DAC status and control over its configuration, primarily selecting between inputs. Status display is provided by the five LEDs on the front panel. The siliconchip.com.au LEDs in the three illuminated buttons show which of the three channels is currently selected. They correspond, left-to-right, to the inputs on the rear panel, with the RCA S/PDIF input being number 3. The two other LEDs indicate whether there is a valid S/PDIF signal detected on that channel (yellow LED) and whether any audio data is present (green LED). The yellow LED also flashes to acknowledge signals from the remote control. Holding down various combinations of the buttons on the front panel allows you to enter a set-up mode where you can assign remote control functions and configure the automatic input switching. The automatic input switching allows the DAC to select whichever inSeptember 2009  13 Specifications Signal-To-Noise Ratio: -108dB (unweighted, 22Hz – 22kHz); -114dB (A-weighed), both with respect to 2V RMS Total Harmonic Distortion: <0.0018% <at> 1kHz and 2V RMS Channel Separation: -105dB <at> 100Hz & 1kHz; -85dB <at>10kHz; -73dB <at> 20kHz Linearity: within 1dB <at> -90dB Frequency Response: +0.0, -0.15dB, 20Hz-20kHz Supported Sample Rates: 28-108kHz Supported bit depths: 16-bit, 20-bit & 24-bit Supported Channel Formats: stereo PCM Clock Jitter: jitter tolerant; clock jitter is typically less than 50 picoseconds put has a valid signal. It allows you to leave the DAC on and switch between various input sources, without the need to manually change channels. For example, if you have a DVD player and set-top box connected, and after watching a DVD you switch the DVD player off and the set-top box on, the DAC will change inputs by itself about 10 seconds after you’ve turned the DVD player off. This delay can be changed depending on your preference. It works as follows. In operation, the DAC constantly monitors the current input status for two parameters: (1) the presence of an S/PDIF signal and (2) the presence of audio data (non-silence). This is the same information which is displayed via the status LEDs. After a user-defined period (default 10 seconds) without a valid signal, the input channels will enter a “scanning” mode where each input is rapidly selected in turn. This scanning continues until a valid signal is detected at which point it stops on that input. There is also a user-defined period of silence (default 1 minute) after which scanning will begin, even with a valid signal present. This is because many devices with digital audio outputs keep their outputs active even when they are not playing any material, eg, when the DVD is stopped. Thus the only reliable way to determine if content is actually being played is to look for an audio signal. Of course, you don’t want it to start scanning the instant there is silence, as there are often short silent periods between tracks, or you may be changing discs or briefly pausing playback. 14  Silicon Chip The two delays can be configured from 100ms up to several hours, or disabled entirely. In addition, it’s possible to configure different delays if the current channel has been manually selected, either from the front panel buttons or the remote control. This is so that you can set the automatic scan times fairly short without having it start scanning too soon after you force it to a particular channel. By default these delays are set to five minutes without a signal and scan on silence after a manual channel change is disabled. Default input & volume control There is also the matter of which input is active when power is first applied. By default the first input is selected but you can configure it so that the default is any of the three inputs, or so that it immediately scans, or even so that it starts up with whichever input last had a valid signal before it was powered off. Finally, there is a built-in volume control in the DAC and it is possible to use the remote control to change the volume. This has a 30dB range but we don’t recommend using it if you want the very best sound quality. Because the volume control is digital, total harmonic distortion will become worse as the volume is reduced. If you do control the volume using a remote, it will remember the last setting the next time it is powered on. The initial default is maximum volume and that’s where it should be left for best sound quality. Note also that multi-channel audio formats like DTS or Dolby Digital are not supported and in any case, many DVD players turn off the TOSLINK (optical) output when multi-channel modes are employed. This means you have two choices when using this DAC with a DVD player in a home-theatre configuration. One option is to connect the DVD player’s outputs directly to your amplifier along with the DAC outputs using a separate set of cables and switch between them, depending on whether you are playing multichannel or stereo content. Alternatively, if you only have stereo speakers, you can configure your DVD player to convert multi-channel content to stereo on the digital output and play all content via the DAC. Some, but not all, DVD players have such a feature which is usually configured via an on-screen menu. If you just want to use a DVD player to play CDs you can ignore the DVD player’s stereo outputs altogether and just use the digital output. It is also possible to use a CD player with digital outputs although they are becoming less common. Because the DAC supports 24-bit 96kHz content as well as CD quality (16-bit, 44.1kHz) and other common audio formats, it is also possible to play higher definition audio content. The supported range of sample rates is 28-108kHz and recognised bit depths are 16, 20 & 24 bits (although in reality 16-bit content is always promoted to 20 bits when sent via S/PDIF). This covers most common linear audio formats. De-emphasis is also supported, although very few CDs are recorded with it enabled. However, de-emphasis has been included since it is part of the CD Audio “Red Book” standard. While the ability to play back 24-bit 96kHz content is attractive, there is a catch: many devices capable of playing back audio of this quality disable their digital outputs when doing so! This likely includes all “DVD Audio” players, which is a great pity. Presumably the music industry was worried about people making digital copies of such content and thus deny us the ability to use the digital output for high-quality content at all. No wonder DVD Audio failed to take off! However, even plain old CDs will sound great played back through this DAC as long as they were properly recorded and mastered. Regarding the audio quality, not only does the DAC chip itself provide high-quality audio output but the S/ PDIF decoder “re-clocks” the audio siliconchip.com.au Fig.1: block diagram of the Stereo Digital-To-Analog Converter. It has two TOSLINK (optical) inputs and one coaxial input and these are fed to an S/PDIF decoder (IC3) via a multiplexer (IC2) and then to a stereo DAC (IC6). The DAC then drives current-to-voltage converter stages IC7, IC8, IC10 & IC11 and finally the differential amplifier output stages (IC9 & IC12). The circuit is controlled by microcontroller IC4 which selects the input signal and accepts inputs from the IR remote control receiver and the pushbutton switches. data to remove “clock jitter”. Clock jitter refers to the fact that the clock frequency of the data being transmitted over the digital link varies somewhat sample to sample. Ideally, there will be no jitter, meaning the clock pulses (and thus data bits) come at exactly the same interval but consumer equipment often doesn’t have the best clock stability and this can prejudice the dynamic range. The decoder solves this by re-clocking the data using a Phase Locked Loop (PLL). The PLL’s frequency is locked to the sample frequency of the data being received but because only the average clock frequency determines the PLL frequency, if the PLL is sufficiently stable it will reject most of the jitter. The DIR9001 decoder from Texas Instruments/Burr Brown claims a typical specification of around 45 picoseconds jitter at 44.1kHz and 30 picoseconds jitter at 96kHz when the master clock is running at 512fs, which is how it is configured. You may be wondering why the decoder IC chosen isn’t capable of handling sample rates up to 192kHz. After all, the DSD1796 DAC supports this sample rate and some content is available at 192kHz, so it would be nice to support it. The main reason is that Burr Brown does not make a 192kHz S/PDIF decoder, and other choices such as the Crystal CS8416 have inferior specifications, including jitter tolerance. For the CS8416, the output jitter is quoted as around 100ps – twice that of the DIR9001. Since most content available is still 44.1kHz or 48kHz, and since the difference in quality between 96kHz and 192kHz audio is minimal, we feel that the DIR9001 is the superior device. PC board line-up Inside the chassis, the circuitry is accommodated on four PC boards: an Input & Control Board, a Front-Panel Switch Board, a Stereo DAC/Analog Board and a Power Supply Board. In the block diagram of Fig.1, the Stereo DAC and all blocks to its right are mounted on the DAC/Analog Board while the circuitry to the left is on the control board. The front panel board carries the buttons, LEDs and an infrared remote control receiver. Not shown on Fig.1 is the power supply board. This is identical to that used in the Studio Series Stereo Preamplifier (see October 2005) and is available from both Jaycar (Cat. KC-5418) and Altronics (Cat. K-5501) as a kit. It can be run from a small 150-15V toroidal transformer or from a 15VAC plugpack. Block diagram Fig.1 shows the main circuit sections. To the left are the two TOSLINK inputs, the S/PDIF input and the infrared remote control receiver. These are fed into multiplexer IC2 and then to the S/PDIF decoder IC3. The output of the decoder in turn feeds the Stereo Issues Getting Dog-Eared? Keep your copies safe with these handy binders. REAL VALUE AT $14.95 PLUS P & P Available Aust, only. Price: $A14.95 plus $10.00 p&p per order (includes GST). Just fill in and mail the handy order form in this issue; or fax (02) 9939 2648; or call (02) 9939 3295 and quote your credit card number. siliconchip.com.au September 2009  15 TOSLINK RECEIVER 2 3 100nF 100nF 1 100pF 2 16 Vdd 11 Ya3 15 Ya2 Za 13 14 Ya1 12 Ya0 TOSLINK RECEIVER 1 3 IC2 74HC4052 100nF 4 Yb3 2 Yb2 1 Zb 3 5 Yb1 1 Yb0 100pF 2 6 IC1: 74HCU04 K S/PDIF INPUT CON1 10k D10 100nF A 100 Vee Vss 7 8 9 10 IC1e 14 12 10 11 7 K 300 S0 100nF IC1f 13 S1 E +5V D9 A +5V K 5V DC POWER INPUT +5V 0V 470 F 3  470nF A OUT IN IRD1 D14 1N4004 REG4 LM3940T-3.3 +3.3V +5V GND 22 F 100nF 1 6 6 5 5 3 3 4 4 12 12 100nF 1M 22k IC5: 74HC14 47k 5 D11 1nF 1 F 22k 22k 22k K 10 13 LED5 LED4 S1 S2 A  K S3 A  K LED1 A A  K LED2 K  K 12 A 1 1 2 2 14 14 13 13 22k 1 F D13 8 A  IC5f 10 A 8 6 IC5c +5V A 2 14 D12 K 22k 1 IC5a 2 1 F K 3 IC5b 4 7 2x 330 LED3 7 7 9 9 11 11 FRONT PANEL SWITCH BOARD SC 2009 STEREO DIGITAL-TO-ANALOG CONVERTER INPUT & FRONT PANEL BOARDS Fig.2: the Input Board carries the TOSLINK & S/PDIF inputs, the multiplexer (IC2), the S/PDIF decoder (IC3) and the microcontroller (IC4). The Front Panel Switch Board (yellow background) carries the switches, LEDs and IR receiver. 16  Silicon Chip siliconchip.com.au DIGITAL I/O +3.3V 1 3 100nF 100nF 5 14 13 26 25 20 27 3 2 1 100 7 X1 24.576MHz 33pF 8 24 Vcc Vdd DOUT PSCK0 BCKO FMT1 LRCKO FMT0 CLKST ERROR RST FSOUT1 CKSEL FSOUT0 RSV AUDIO FILT XTO XTI 8 11 6 10 10 9 SCKO IC3 DIR9001 DGnd 6 33pF 12 PSCK1 RXIN 22 F 4 4 5 21 +3.3V 28 19 Q1 BC327 22 BFrame 18 17 EMPH 16 Uout 15 Cout E 47k B C Q2 BC327 680 E B 47k 15 C 14 4.7nF AGnd 23 16 12 47k 68nF 2 +5V 100nF 7 20 Vcc 19 18 17 15 13 14 9 100nF AVcc PB5 PB2 PB4 PC4 PB3 PC5 PB1 PC3 PD7 PC2 PB0 PC1 PC0 PB6 RST 16 27 28 7 26 9 25 11 24 13 23 (TO DAC BOARD) 1 IC1c IC1a 1 12 11 10 PD6 3 IC4 ATMEGA48/V IC1b 2 5 4 9 IC1d IC5d 6 9 8 11 PB7 A 6 2 3 4 3x 2.2k D14: 1N4004 K A LED4 PD3 PD4 PD0 AREF GND GND 100nF K A LM3940T-3.3 BC327 22 B E K LED5 K A 21 PD1 PD2 8 siliconchip.com.au 10 PD5 D9–D13: 1N4148 5 IC5e 8 GND IN C GND OUT September 2009  17 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, DAC (IC6) while all three are under the control of the microcontroller (IC4). IC4 also accepts inputs from the ill­uminated pushbutton switches and from the IR remote receiver (after filtering) and it drives the LEDs. The DAC has two sets of differential outputs and these drive four currentto-voltage converter stages involving IC7, IC8, IC10 & IC11. The four balanced voltage outputs from these stages then drive differential op amps IC9 & IC12 to derive the left and right audio outputs, respectively. Circuit details Now let’s have a detailed look at the circuitry of the Input & Control Board – see Fig.2. The two TOSLINK optical receivers each deliver a TTL (5V peak) output signal. The coaxial input is a little more tricky because S/PDIF over coaxial cable (75Ω) is a fairly low level signal – around 0.5V peak-to-peak and even less after cable termination. Therefore the coaxial signal receiver circuit consists of an amplifier which boosts this signal to TTL levels. This part of the circuit is identical to that found in the Two-Way SPDIF/ Toslink Digital Audio Converter (SILICON CHIP, June 2006), with one exception. The 74HC04 IC has been replaced 18  Silicon Chip 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. with a 74HCU04 (IC1). This has two effects: (1) the current consumption is reduced significantly when there is no signal present on this input and (2) the inverter does not oscillate in this condition. The resulting three TTL S/PDIF signals, one from each input, are then fed into the 74HC4052 analog/digital multiplexer (IC2). Just think of IC2 as a selector switch under the control of the microcontroller (IC4). Depending on which input is selected by the microcontroller, one of them is fed into the DIR9001 Digital Audio Interface Receiver (IC3). This does the S/PDIF decoding. The DIR9001 requires a 3.3V supply which is provided by an LM3940T-3.3 3-terminal regulator (REG4). IC3 employs a 24.576MHz crystal together with two 33pF load capacitors and a 100Ω current-limiting resistor. This provides a frequency reference for the decoder, to determine the actual sampling rate of the audio signal. This is necessary in order to provide the ability to apply digital de-emphasis, since the digital filter response needs to match the sample frequency. The DIR9001 also requires two 5% metal-film capacitors (4.7nF and 68nF) and a 1% metal-film resistor (6.8kΩ) to form the PLL loop filter. The remaining decoder associated components are power supply bypass capacitors. The DIR9001 decoder converts the digital signal into a serial PCM stream (DOUT) which is passed directly to the DAC chip itself, along with three clock signals. These are the sample clock (LRCKO), bit clock (BCKO) and master clock (SCKO). The sample clock matches the audio signal’s sample rate while the bit clock is generally 64 times that rate and is used to clock the actual data. The master clock signal is also a multiple of the sample rate – in this case, 512 times. The master clock is used to time the DAC’s oversampling, which not only makes the post-DAC analog filters easier to design but is also required for a delta-sigma architecture DAC such as used in this circuit. The decoder also outputs a number of flags which are set according to the contents of the S/PDIF stream. These indicate whether there is a valid signal present (AUDIO, ERROR) and whether the audio has been pre-emphasised (EMPH). In addition, FSOUT0 & FS­ OUT1 indicate the detected sample rate. There is one additional connection to the DIR9001 and that is a reset line (RST) from the microcontroller. Acsiliconchip.com.au siliconchip.com.au September 2009  19 7 9 6 4 1 8 10 11 12 13 14 2 13 11 9 7 5 100nF 6 8 3 4 5 10 3 12 IC6 DSD1796 +IoutR –IoutR Iref +IoutL –IoutL VcomR VcomL 23 15 Vcc1 Vcc2R DAC BOARD STEREO DIGITAL-TO-ANALOG CONVERTER 17 18 20 25 26 21 22 100nF AG1 AG2 AG3L AG3R 19 16 27 24 RST MDO MC MDI MS DGnd Vdd SCK PBCK PDATA PLRCK DBCK DSDR DSDL 28 Vcc2L 100nF 10k 47 µF 47 µF 47 µF -15V 2.7nF 820Ω -15V 2.7nF 820Ω -15V 2.7nF 820Ω -15V 2.7nF 820Ω 3 2 3 2 3 2 3 2 4 IC11 7 4 IC10 7 4 IC8 7 4 IC7 7 8 6 +15V 8 6 +15V 100nF 5 6 100nF 8 22pF 5 22pF 100nF 5 6 100nF 8 22pF 5 22pF 200Ω 200Ω 220Ω 27nF 220Ω 200Ω 200Ω 220Ω 27nF 220Ω 3 2 4 IC9 7 8 6 100nF 5 22pF -15V A 3 2 K 1N4004 8.2nF 180Ω 180Ω 8.2nF 4 IC12 7 8 6 100nF 5 22pF GND IN 2.2nF 100Ω OUT 7805 -15V 2.2nF 100Ω +15V IC7–IC12: OPA134 OR NE5534 (SEE TEXT) 8.2nF 180Ω 180Ω 8.2nF +15V GND RIGHT OUTPUT LEFT OUTPUT Fig.3: the DAC Board carries the DAC chip (IC6). This accepts the PCM signals from IC3 and drives current-to-voltage converter stages IC7, IC8, IC10 & IC11. These op amps in turn drive differential amplifiers IC9 & IC12 derive the left and right channel audio outputs, respectively. The op amps are powered by ±15V rails from the power supply while REG5 provides a +5V rail to power the DAC. SC 2009 47 µF 10 µF OUT GND 1 IN 2 -15V A REG5 7805 K 14 100 µF 25V 100 µF 25V 16 15 -15V 0V +15V DIGITAL I/O P3 P2 P1 POWER INPUT D15 1N4004 The front panel is uncluttered and carries just the power switch, the three input selector pushbuttons (with their integral blue LEDs) and the valid signal and audio data indicator LEDs. The hole in the panel immediately to the left of the pushbuttons is for the IR detector (IRD1). The rear panel carries the left & right audio output sockets, the coaxial & TOSLINK input sockets, the fuseholder and the IEC mains connector. cording to the DIR9001 data sheet, an external reset is required each time power is applied. The microcontroller provides this reset signal by monitoring the 3.3V line with its ADC and holding reset low until the supply rises above 2.7V, as specified in the data sheet. Atmel microcontroller Controlling the whole circuit is the Atmel Mega48/V microcontroller (IC4). This is powered by the main +5V rail which comes from the power supply board described later. Note that the switch buttons (S1S3) are not connected directly to the micro but rather via some RC filters and a 74HC14 hex Schmitt trigger inverter (IC5). This is because when a button is pressed, the contacts tend to 20  Silicon Chip “bounce” and switch rapidly on and off for a short period. Each RC filter and its associated diode delays the button press detection long enough to allow the bounce to cease and the Schmitt trigger inverter adds hysteresis to provide a minimum “on” pulse to the microcontroller. De-bouncing can also be performed in software but the hardware method has its advantages and it’s one less task for the microcontroller to perform. Similarly, the IR receiver’s output is fed to microcontroller IC4 via an RC filter and Schmitt trigger IC5c. This is done to filter out any noise generated by other IR sources in the room (apart from the remote), which could cause false triggering in the microcontroller. By filtering the IR receiver’s output, we ensure that only signals with a minimum pulse width are detected. Basically, the Philips RC5 code “ontime” is a minimum of around 889µs (32 pulses at 36kHz), so the filter is designed to reject any shorter IR pulses. Again, this is not strictly necessary but it only requires a few parts and results in more reliable remote control operation. DAC board Fig.3 shows the DAC Board circuit. The DAC chip itself is a Texas Instruments/Burr Brown DSD1796 (IC6) and, as previously stated, has two pairs of differential current outputs rather than voltage outputs. These are current sinks and the current is directly proportional to the sample value after conversion. This allows for higher performance siliconchip.com.au siliconchip.com.au Fig.4: the low-noise linear supply for the Digital-To-Analog Converter is based on common 3-terminal regulators. It provides ±15V rails to power the audio op amps plus a +5V rail to power the Input & Control Board. than would be possible with a voltageoutput DAC of similar design, as the external op amps can run at higher supply voltages (ie, ±15V) and with separate supply bypassing. There are a number of support components around the DSD1796, most of them supply bypass capacitors. In addition, there is a 10kΩ resistor on pin 20 which sets the output level of the DAC, while a 47µF capacitor between pins 21 & 22 and the supply at pin 23 stabilises the DAC’s internal reference voltage. The first analog stage following each of the four outputs from IC6 is a current-to-voltage converter and lowpass filter. Each stage consists of a single op amp (IC7, IC8, IC10 & IC11) plus an 820Ω resistor and 2.7nF capacitor. The low-pass filter is the first September 2009  21 Par t s Lis t Chassis Hardware 1 1U-high custom steel case with screened front & rear panels 1 15V+15V 30VA or 20VA toroidal transformer (Altronics M-4915A; Jaycar MT-2086) 1 SPST 6A 250VAC slimline rocker switch (Jaycar SK-0975; Altronics S-3202) 1 male chassis-mount IEC socket (Jaycar PP-4005, Altronics P-8325) 1 M205 safety fuseholder (Jaycar SZ-2028, Altronics S-5992) 1 M205 250VAC 500mA slow-blow fuse 1 230VAC 3-pin IEC mains power lead 5 5.3mm ID insulated crimp eyelets (Jaycar PT-4614) 4 M4 x 10mm machine screws 8 M4 nuts 8 M4 shakeproof washers 5 4.8mm fully-insulated female spade crimp connectors 20 small Nylon cable ties 1 40mm-length of 16mm-ID heatshrink tubing (to cover fuseholder) 1 30mm-length of 20mm-ID heatshrink tubing (to cover mains switch) Wire & Cable 1 400mm-length heavy-duty red hook-up wire 1 240mm-length heavy-duty green hook-up wire 1 320mm-length heavy-duty black hook-up wire 1 350mm-length 7.5A 250VAC brown wire for mains cabling of three, the total effect of which rolls off the frequency response at 18dB/ octave above about 24kHz. In operation, the left channel differential outputs from the DAC (IC6), are converted from current to voltage using op amps IC7 & IC8. Their outputs are in turn fed to a passive filter which consists of 220Ω resistors and a common 27nF capacitor. The filtered differential outputs are then combined by op amp IC9 which acts as a differential amplifier and active low-pass filter. Op amps IC10, IC11 & IC12 function 22  Silicon Chip 1 500mm-length 7.5A 250VAC green/yellow wire for mains cabling Input Board 1 PC board, code 01109091, 113 x 93mm 2 PC-mount TOSLINK (optical) receivers (Jaycar ZL-3003, Altronics Z-1602) 1 black PC-mount RCA socket 1 14-pin PC-mount IDC header socket 1 16-pin PC-mount IDC header socket 1 14-pin IDC line socket 1 16-pin IDC line socket 1 3-pin header & shorting jumper 1 500mm-length 16-way IDC ribbon cable 1 2-way screw terminal block, 5.08mm pitch 2 14-pin DIP machined IC sockets 1 16-pin DIP machined IC socket 1 28-pin DIP machined IC socket 5 M3 x 10mm tapped spacers 10 M3 x 6mm machine screws 1 500mm-length 0.71mm tinned copper wire (for links) 1 24.576MHz crystal (HC/49 or HC/49US) (Rockby Electronics) Semiconductors 1 74HCU04 hex inverter (IC1) – do not use 74HC04 1 74HC4052 analog/digital multiplexer (IC2) 1 DIR9001PW Digital Audio Interface Receiver (IC3) 1 ATMEGA48V or ATMEGA48P microcontroller programmed with 0110909A.hex (IC4) in exactly the same manner to produce the right channel audio output. Output op amps Virtually all of the circuit for the DAC Board circuit is as suggested in the Texas Instruments’ data sheet for the DSD1796. However, we did make some important changes. First, after extensive testing, we decided that OPA134 op amps are the best available for this circuit, rather than the NE5534s specified by TI. These are from the same op amp family as the OPA2134 dual op amps 1 74HC14 hex Schmitt trigger inverter (IC5) 1 LM3940T-3.3 LDO 3-terminal regulator (REG4) 2 BC327 PNP transistors (Q1,Q2) 5 1N4148 diodes (D9-D13) 1 1N4004 diode (D14) Capacitors 1 470µF 6.3V electrolytic 2 22µF 6.3V electrolytic 3 1µF 6.3V electrolytic 1 470nF MKT metallised polyester 11 100nF MKT metallised polyester 1 68nF MKT metallised polyester 1 4.7nF MKT metallised polyester 1 1nF MKT metallised polyester 2 33pF ceramic 2 100pF ceramic Resistors (0.25W, 1%) 1 1MΩ 1 680Ω 4 47kΩ 2 330Ω 6 22kΩ 1 300Ω 1 10kΩ 2 100Ω 3 2.2kΩ DAC Board 1 PC board, code 01109092, 94 x 110mm 1 red PC-mount RCA socket 1 white PC-mount RCA socket 1 16-pin PC-mount IDC header socket 1 16-pin IDC line socket 1 3-way screw terminal block, 5.08mm pitch 4 M3 x 10mm tapped spacers 8 M3 x 6mm machine screws 1 500mm-length 0.71mm tinned copper wire (for links) used in the Studio Series Preamplifier, referred to earlier. Alternatively, you can use NE5534s if you wish although these will give a slight increase in harmonic distortion – from around 0.0018% or better to 0.0025% at 1kHz. In view of this, we feel that the OPA134s are worth the extra cost. Note that six 22pF compensation capacitors are shown on the DAC circuit but these are only necessary if you use NE5534s. They may be omitted if you are using OPA134s. However, if you install them anyway, OPA134s can siliconchip.com.au 6 8-pin DIP machined IC sockets Semiconductors 1 DSD1796 24-bit audio DAC (IC6) 6 OPA134 op amps (IC7-IC12) (or use NE5534 op amps for slightly reduced performance) 1 7805 +5V regulator (REG5) 1 1N4004 diode (D15) 1 100nF MKT metallised polyester capacitor Capacitors 2 100µF 25V electrolytic 4 47µF 16V electrolytic 1 10µF 6.3V electrolytic 9 100nF MKT metallised polyester 2 27nF MKT metallised polyester 4 8.2nF MKT metallised polyester 4 2.7nF MKT metallised polyester 2 2.2nF MKT metallised polyester 6 22pF ceramic Power Supply Board Resistors (0.25W, 1%) 1 10kΩ 4 200Ω 4 820Ω 4 180Ω 4 220Ω 2 100Ω Front Panel Switch Board 1 PC board, code 01109093, 103 x 34mm 3 vertical PC-mount momentary pushbutton switches with blue LEDs (S1-S3) (Jaycar SP-0622 or Altronics S-1173) 1 14-pin PC-mount IDC header socket 1 14-pin IDC line socket 4 M3 x 6mm tapped Nylon spacers 4 M3 x 15mm black-anodised pan-head machine screws 4 M3 star washers 4 M3 nuts 1 100mm-length 0.71mm tinned copper wire (for links) still be used, as pin 5 of the OPA134 package is not internally connected. Our second departure from the recommended Texas Instruments’ DSD1796 circuit was to use a single 100nF bypass capacitor across the supply pins (7 & 4) of each amp. This avoids coupling supply noise into the signal ground and also provides effectively twice as much capacitance. Third, we added a fourth low-pass (passive) filter stage to the outputs of op amps IC9 & IC12. This consists of a 2.2nF capacitor following the 100Ω current-limiting resistors and provides siliconchip.com.au Semiconductors 1 infrared receiver module (IRD1) (Jaycar ZD-1952; Altronics Z-1611) 1 5mm yellow LED (LED4) 1 5mm green LED (LED5) 1 PC board, code 01109052, 54.6 x 80mm 1 Micro-U 19°C/W TO-220 heatsink (Altronics H-0637) 2 3-way terminal blocks, 5.08mm pitch (CON1, CON2) 1 2-way terminal block, 5.08mm pitch (CON3) 4 6mm untapped Nylon spacers 5 M3 x 6mm pan head screws 1 M3 nut & flat washer Semiconductors 1 LM317T adjustable positive regulator (REG1) 1 LM337T adjustable negative regulator (REG2) 1 7805 +5V regulator (REG3) 8 1N4004 diodes (D1-D8) Capacitors 2 2200µF 25V PC electrolytic 2 100µF 16V PC electrolytic 1 47µF 25V PC electrolytic 3 10µF 16V PC electrolytic 2 100nF 50V MKT metallised polyester Resistors (0.25W, 1%) 2 1.1kΩ 2 100Ω 1 330Ω 5W 5% 1 100Ω 5W 5% a rolloff (pole) at roughly 800kHz. This will slightly attenuate any highfrequency switching artefacts present on the output of the DAC. In addition, since this is a passive filter, it will be effective at filtering any very highfrequency noise which some of the active filter stages may pass through. Power supply As noted, this design uses the lownoise power supply from the Studio Series Preamplifier (SILICON CHIP, October 2005). It provides regulated ±15V and +5V outputs. The power supply board accepts a 30VAC centre-tapped input from the specified toroidal transformer, formed by joining the two 15VAC secondary windings. D1-D4 and two 2200µF capacitors rectify and filter the input to give ±21V DC (nominal) rails. LM317 and LM337 adjustable reg­ ulators (REG1 & REG2) generate the complementary positive and negative supply rails. Their outputs are programmed to ±15V by the 100Ω and 1.1kΩ resistors connected to their OUT and ADJ terminals. We’ve used adjustable regulators because the ADJ terminals can be bypassed to ground to improve ripple rejection, which we’ve done using 10µF capacitors. Diodes D5 & D7 provide a discharge path for the capacitors should an output be accidentally shorted to ground. Two reverse-connected diodes, D6 & D8, across the outputs prevent their respective rails from being driven to the opposite polarity (eg, if a regulator fails), something that should never occur during normal operation. A 7805 regulator (REG3) is used to generate the +5V rail. The 100Ω resistor in line with REG3 reduces power dissipation in the regulator. As the +5V supply draws power from only the positive side of the unregulated DC input, a 330Ω resistor across the negative input is included to balance the rails so that they decay at similar rates at power off. The +5V rail provides the power to the circuitry on the main Control Board as well as driving the LM3940T-3.3 regulator which provides power for the DIR9001 decoder. This regulator also provides a +3.3V rail (Vdd) for the DAC. It might seem strange to use a 7805 for REG3 when we want a low-noise supply but in fact this series of regulators have quite low output noise when used with a decent-sized output capacitor. Finally, the +5V rail for the analog section of the DAC does not come from REG3 on the power supply board. Instead, we use another LM7805 5V regulator on the DAC board and this is powered from the +15V rail from the power supply. This is so that digital switching noise in the 5V digital supply does not affect the DAC’s performance. Next month, we’ll show you how to assemble the four PC boards and SC mount them in the case. September 2009  23