Silicon ChipTwo-Way SPDIF/Toslink Digital Audio Converter - June 2006 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Mobile phone users have increased risk of brain damage
  4. Feature: GM Allison’s Hybrid Drive Bus by Julian Edgar
  5. Feature: New 6-Chip Ultra-Bright LED by Silicon Chip
  6. Feature: Television: The Elusive Goal; Pt.1 by Kevin Poulter
  7. Project: Pocket A/V Test Pattern Generator by Mick Gergos
  8. Project: Two-Way SPDIF/Toslink Digital Audio Converter by Jim Rowe
  9. Salvage It: A High-Current Car Battery Charger For Almost Nothing by Julian Edgar
  10. Feature: Electric-Powered Model Aircraft; Pt.2 by Bob Young
  11. Project: Build A 2.4GHz Wireless A/V Link by Ross Tester
  12. Project: Starship “Enterprise” Door Sounder by Jim Rowe
  13. Vintage Radio: The Kriesler 41-29 "Trans-Mantel" by Rodney Champness
  14. Book Store
  15. Advertising Index
  16. Outer Back Cover

This is only a preview of the June 2006 issue of Silicon Chip.

You can view 40 of the 112 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.

Articles in this series:
  • Television: The Elusive Goal; Pt.1 (June 2006)
  • Television: The Elusive Goal; Pt.1 (June 2006)
  • Television: The Elusive Goal; Pt.2 (July 2006)
  • Television: The Elusive Goal; Pt.2 (July 2006)
  • Television – The Elusive Goal; Pt.3 (August 2006)
  • Television – The Elusive Goal; Pt.3 (August 2006)
Items relevant to "Pocket A/V Test Pattern Generator":
  • Pocket A/V Test Pattern Generator PCB [PAVTSG] (AUD $10.00)
  • PIC16F84A-20(I)/P programmed for the Pocket A/V Test Pattern Generator (Programmed Microcontroller, AUD $15.00)
  • PIC16F84A firmware and source code for the Pocket A/V Test Pattern Generator (Software, Free)
  • Pocket A/V Test Pattern Generator PCB pattern (PDF download) (Free)
  • Pocket A/V Test Pattern Generator front panel artwork (PDF download) (Free)
Items relevant to "Two-Way SPDIF/Toslink Digital Audio Converter":
  • PCB pattern for the 2-Way S/PDIF-TOSLINK Digital Audio Converter (PDF download) [01106061] (Free)
  • Two-Way S/PDIF-TOSLINK Digital Audio Converter front panel artwork (PDF download) (Free)
Articles in this series:
  • Electric-Powered Model Aircraft (February 2006)
  • Electric-Powered Model Aircraft (February 2006)
  • Electric-Powered Model Aircraft; Pt.2 (June 2006)
  • Electric-Powered Model Aircraft; Pt.2 (June 2006)

Purchase a printed copy of this issue for $10.00.

By JIM ROWE Two-Way SPDIF/Toslink Digital Audio Converter Need to convert the Toslink digital audio optical signal from your DVD player into coaxial SPDIF form, to feed the only remaining digital input on your home-theatre amplifier? Or do you want to convert from a coaxial SPDIF signal to Toslink form? This low-cost unit converts digital audio bitstreams either way. M URPHY’S LAW SEEMS to apply to digital audio bitstream signals and inputs just as much as it does to any other aspect of electronics. For example, let’s say that you have only one digital audio input left on your home-theatre amplifier and it’s an optical one. Now guess which kind of digital audio output you’ll find on your new DVD recorder or DTB set-top box when you bring it home? That’s right, Murphy’s Law will ensure that it will be an coaxial output. It won’t be an optical one, because that would match the remaining input on the amplifier and make things easy for 38  Silicon Chip you. On the other hand, if your amplifier has only a coaxial digital input remaining, you can bet your last dollar that your new set-top box will have an optical digital output instead! Either way, these are both situations where the easiest solution is to use a converter – one that can convert coaxial digital audio signals into optical, or vice-versa. And that’s exactly what this little gadget does. It uses only a handful of parts, yet can easily convert coaxial digital bitstream signals into optical form and/or the other way around. It’s also easy to build and will set you back significantly less than a pair of commercial converters. Digital audio signals Basically, the digital audio signals found in domestic equipment are all in the form of SPDIF (Sony/Philips Digital Interface) bitstreams – either as 400mV electrical signals sent along 75ohm coaxial cables or as optical signals (pulses of 660nm red light) sent along fibre-optic cables. The optical signal form is often called “Toslink”. Although domestic digital bitstream audio is split almost equally between the coaxial and optical forms, they’re both virtually identical in terms of the SPDIF/BMC encoding and serialisation used (see panel). So it’s relatively easy to convert between the two, in either direction. In fact, once you get hold of suitable Toslink optical transmitter and receiver modules, the rest is no problem at all. How it works Fig.1 shows the circuit details for the converter. It’s based on a pair siliconchip.com.au of low-cost Toslink optical modules which are now being sold by Jaycar Electronics: the ZL-3002 receiver and the ZL-3000 transmitter. The receiver is used at the input of the optical-to-coaxial converter section at the top of Fig.1, while the transmitter is used at the output of the coaxial-to-optical converter section in the centre of the diagram. The bottom part of Fig.1 is the power supply section and this provides a +3.3V DC rail for the other two sections. In operation, the ZL-3002 optical receiver accepts the incoming Toslink optical bitstream and converts it into an electrical signal with roughly TTL logic levels at its pin 1 output. This is then fed through CMOS inverter stage IC1f and then through parallel-connected inverter stages IC1a, IC1b & IC1c which together act as a buffer. The resulting “squared-up” signals are then fed through a 150nF DC blocking capacitor to a voltage divider consisting of 390W, 220W & 160W resistors. This divider network delivers a 400mV peak-to-peak SPDIF signal to output connector CON2 and also ensures correct impedance matching, so the output signal is at the required 75W impedance level. And that’s all there is to the optical-to-coaxial converter. The second converter stage is just as straightforward. The incoming coaxial bitstream signal is fed to CON1 and then fed via a 100nF capacitor to a Schmitt trigger stage based on IC1e and its associated 100W and 10kW feedback resistors. This stage “squares up” the bitstream signal and converts it into a 3.3V p-p CMOS signal. The 300W resistor connected across CON1 is included for impedance matching. It acts in conjunction with the 100W resistor in the signal path to give a 75W input impedance. The output from IC1e appears at pin 10 and is fed to inverting buffer stage IC1d. This in turn drives the ZL-3000 Toslink transmitter module where it is converted into an optical bitstream signal. Power supply The power supply section has been designed so that the converter can be operated from almost any source of 9-12V DC capable of supplying about 55mA. This means you can operate it from either a small plugpack supply or from batteries. The incoming 9-12V DC is first siliconchip.com.au RFC1 47 µH +3.3V 150nF 1 14 100nF 2 CO-AXIAL SPDIF OUT IC1a 3 IC1f 1 13 3 12 DIGITAL OPTICAL RECEIVER (ZL-3002* ) 2 150nF 4 390Ω CON2 IC1b 5 220Ω 6 160Ω IC1c IC1: 74HC04 10k CO-AXIAL S/P-DIF IN +3.3V 150nF 2 100nF 100Ω CON1 11 IC1e 10 IC1d 9 8 3 7 300Ω 1 DIGITAL OPTICAL TRANSMITTER (ZL-3000* ) D2 1N4004 K 9-12V DC INPUT D1 1N4004 CON3 A * JAYCAR CAT. NUMBER A REG1 7805 K IN 39Ω OUT GND 470 µF 25V +3.3V K ZD1 3.3V 10 µF A 1N4004 A SC 2006 K IN ZD1 A K 7805 GND OUT TWO-WAY SPDIF/TOSLINK CONVERTER Fig.1: the circuit is based on a pair of Toslink optical modules (a receiver and a transmitter) plus hex inverter stage IC1 to buffer the output and input signals. Power can come from any 9-12V DC source – eg, a plugpack or batteries. passed through reverse-polarity protection diode D1 and filtered using a 470mF capacitor. The resulting DC rail is then applied to 3-terminal regulator REG1 (7805) to derive a well-regulated +5V rail. This is then further regulated down to +3.3V (as required by the Toslink modules) using a 39W resistor and zener diode ZD1. Diode D2 protects REG1 from damage if the 9-12V DC input is disconnected while the 10mF electrolytic capacitor across the regulator’s output is fully charged. Construction This unit is a cinch to build. As shown on Fig.2, all the parts (including the connectors) are mounted on a single PC board coded 01106061 (76 x 46mm). This fits neatly inside a UB5size jiffy box (83 x 54 x 31mm) – or more accurately, it mounts directly on the inside of the lid, with the outside of the lid being used as the base. Note that the board has a rounded cutout at each corner, so that it clears the integral pillars in the box. Fig.2 shows how to install the parts. Begin by fitting the resistors, making sure you fit the correct value in each position. Table 1 shows the colour codes but we recommend that you also check them using a digital multimeter, just to make sure. Follow these with the 47mH RF choke, then fit the monolithic and MKT capacitors. The 10mF tantalum June 2006  39 What Are SPDIF And Toslink? The acronym SPDIF (or S/PDIF) 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. SPDIF 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, and 470mF electrolytic capacitors can then go in, taking care to ensure they are correctly orientated (since they are polarised). Next, fit the two 1N4004 diodes (D1 & D2), followed by zener diode ZD1. Once again, these parts are polarised so be sure to fit them with their banded ends orientated as shown. Regulator REG1 is next on the list. This mounts horizontally with its three leads bent down by 90°, so that they pass through their respective holes in the PC board. To do this, first bend its leads down­ wards about 5mm from its body, then fit the device in position and secure its metal tab to the board using an M3 x 6mm machine screw and nut. SPDIF has also been adapted for conveying compressed digital audio, including Dolby Digital (AC-3), DTS and MPEG-2 audio. Toslink is essentially just the SPDIF 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 SPDIF/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 SPDIF or Toslink digital audio inputs and outputs, or quite often a mixture of both. Similarly, many hometheatre amplifiers are provided with coaxial SPDIF and/or Toslink inputs. This is also the case with many up-market PC sound cards. The Toslink receiver and transmitter modules can now go in. These are very similar in appearance but it’s impossible to get them mixed up since the receiver module has five pins while the transmitter has just three connection pins plus two plastic locating spigots. The final component to fit to the board is IC1. An IC socket was fitted to the prototype but this is optional and you can solder the IC straight in instead. Make sure that the device is orientated as shown in Fig.2, with its notched end towards the left. If you are soldering the IC in directly, take care because it’s a CMOS device and easily damaged by static electricity. The rules are quite simple: use an earthed soldering iron, discharge yourself of static before handling the device, avoid touching the pins and solder pins 7 & 14 first (to enable the internal protection diodes). Final assembly The board assembly is now complete and the next step is to drill and cut the various holes in the box. Fig.3 shows the details. Note that the round 9mm hole for CON2 on the righthand end of the box has an 8mm-wide slot cut below it, to allow final case assembly with the board mounted on the lid. Note also that the 9mm hole for the power connector (CON3) must go in the rear of the box – see Fig.3 and the photo. Table 1: Resistor Colour Codes o o o o o o o o No.   1   1   1   1   1   1   1 40  Silicon Chip Value 10kW 390W 300W 220W 160W 100W 39W 4-Band Code (1%) brown black orange brown orange white brown brown orange black brown brown red red brown brown brown blue brown brown brown black brown brown orange white black brown 5-Band Code (1%) brown black black red brown orange white black black brown orange black black black brown red red black black brown brown blue black black brown brown black black black brown orange white black gold brown siliconchip.com.au Par t s Lis t COAX OUT TOSLINK TX 150nF OPTICAL OUT 3.3V 160Ω 74HC04 390Ω IC1 2 CON2 10k 220Ω 1 100Ω 6002 © 16060110 1 3 150nF 2 100nF TOSLINK RX OPTICAL IN 47 µH 3 + ZD1 150nF REG1 7805 39Ω 100nF D2 300Ω COAX IN CON1 10 µF 470 µF 4004 4004 CON3 D1 9-12V DC IN Fig.2: here’s how to assemble the parts onto the PC board. Make sure that the semiconductors and electrolytic capacitors are correctly orientated. 1 PC board, code 01106061, 76 x 46mm 1 UB5 Jiffy box, 83 x 54 x 31mm 1 Toslink optical receiver (Jaycar ZL-3002) 1 Toslink optical transmitter (Jaycar ZL-3000) 1 47mH RF choke (RFC1) 2 RCA sockets, PC-mount (CON1, CON2) 1 2.5mm concentric DC socket (CON3) 4 M3 x 10mm machine screw, csk head 4 M3 star lockwashers 1 M3 x 6mm machine screw, round head 5 M3 nuts, metal 4 M3 nuts, Nylon Semiconductors 1 74HC04 hex inverter (IC1) 1 7805 +5V regulator (REG1) 1 3.3V 1W zener diode (ZD1) 2 1N4004 diodes (D1,D2) An IC socket was fitted to the prototype but you can solder the IC in if you wish. Note how the 3-terminal regulator (REG1) is mounted. The two rectangular holes are for the Toslink optical transducers. These can be made by drilling a series of small holes around the inside of the marked cutouts, knocking out the centre pieces and filing to shape. The four holes in the lid are for mounting the PC board. After drilling, these should each be fitted with an M3 x 10mm countersink-head screw, a star lockwasher and an M3 Nylon nut – ie, the Nylon nuts form the mounting pillars for the PC board assembly. That done, the PC board can be fitted in position and secured using four M3 metal nuts. The final assembly step is to fit the lid assembly to the case. To do this, you Capacitors 1 470mF 25V RB electrolytic 1 10mF 16V tantalum 3 150nF MKT metallised polyester 1 100nF multilayer monolithic 1 100nF MKT metallised polyester Resistors (0.25W, 1%) 1 10kW 1 160W 1 390W 1 100W 1 300W 1 39W 1 220W The PC board is mounted on the lid of the case, with four M3 Nylon nuts used as standoffs. This assembly is then fitted to the base of the case (right) which must be pre-drilled to accept the various connectors and provide access to the DC socket. siliconchip.com.au June 2006  41 It’s a good idea to leave the plastic dust caps in place on unused Toslink connectors, to keep dust off the lenses. way around (just remove it, rotate it through 180° and replace it). Finally, turn the complete assembly over and fasten the lid down using the four self-tapping screws provided. Your Two-Way SPDIF/Toslink Converter is now ready for use. Quick checkout Fig.3: this full-size diagram can be used as a template to mark out and drill the various holes in the plastic case. first have to remove plastic protection caps from the Toslink connectors. That done, it’s just a matter of slipping the two input connectors through their holes in one end of the case and lowering the other (output) end of the lid assembly into position (ie, by sliding CON2 through its 8mm-wide slot). Now check that the power connector (CON3) is visible through its matching hole in the rear of the case. It not, you’ve got the lid the wrong Fig.4: check your PC board against this full-size etching pattern before installing the parts. 42  Silicon Chip There are no setting-up adjustments but if you’d like to give it a quick functional check first, this is easily done. Simply apply power to CON3 from your 9-12V DC plugpack (centre pin positive) and check that a small beam of red light emerges from the Toslink transmitter on the righthand end of the box. If it is, the odds are that your converter is working as it should. A “no red beam” condition means that you’ve probably connected one of the diodes the wrong way around, or wired up the DC power input plug with the wrong polarity. Otherwise, you can go ahead and use the finished converter to connect your new digital audio source to that otherwise incompatible SPDIF input on your home theatre amplifier, PC sound card or SC DVD recorder. Fig.5: if you’re not building from a kit, this full-size label can be attached using double-sided adhesive tape. siliconchip.com.au