Silicon ChipUSB Test Instrument Interface For PCs - September 2012 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: We need the NBN; pity it's so expensive
  4. Feature: Electronex: The Latest Smart Electronics by Ross Tester
  5. Review: Virtins Technology Multi-Instrument 3.2 by Jim Rowe
  6. Project: Colour MaxiMite Microcomputer, Pt.1 by Geoff Graham
  7. Project: Barking Dog Blaster: Shut That Annoying Mutt Up! by John Clarke
  8. Project: USB Test Instrument Interface For PCs by Jim Rowe
  9. Feature: The HRSA’s 30th Birthday by Kevin Poulter
  10. Project: Digital Sound Effects Generator by Nicholas Vinen
  11. Subscriptions
  12. Review: iModela 3-Axis CNC Router/Mill by Nicholas Vinen
  13. Vintage Radio: A "vintage" radio from just a front panel by Associate Professor Graham Parslow
  14. PartShop
  15. Order Form
  16. Advertising Index
  17. Outer Back Cover

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

You can view 22 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.

Items relevant to "Colour MaxiMite Microcomputer, Pt.1":
  • Colour Maximite PCB [07109121] (AUD $17.50)
  • Colour MaxiMite Firmware, Documentation and Demo software (Free)
Articles in this series:
  • Colour MaxiMite Microcomputer, Pt.1 (September 2012)
  • Colour MaxiMite Microcomputer, Pt.1 (September 2012)
  • Colour MaxiMite Microcomputer, Pt.2 (October 2012)
  • Colour MaxiMite Microcomputer, Pt.2 (October 2012)
Items relevant to "Barking Dog Blaster: Shut That Annoying Mutt Up!":
  • ETD29 transformer components (AUD $15.00)
  • Barking Dog Blaster PCB [25108121] (AUD $10.00)
  • PIC12F675-I/P programmed for the Barking Dog Blaster [2510812A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Barking Dog Blaster Firmware and source code (HEX/ASM) [2510812B.HEX] (Software, Free)
  • Barking Dog Blaster PCB pattern (PDF download) [25108121] (Free)
  • Barking Dog Blaster panel artwork (PDF download) (Free)
Articles in this series:
  • Barking Dog Blaster: Shut That Annoying Mutt Up! (September 2012)
  • Barking Dog Blaster: Shut That Annoying Mutt Up! (September 2012)
  • Wireless Remote Control For The Barking Dog Blaster (October 2012)
  • Wireless Remote Control For The Barking Dog Blaster (October 2012)
Items relevant to "USB Test Instrument Interface For PCs":
  • USB Virtual Instrument Interface PCB [24109121] (AUD $25.00)
  • USB Virtual Instrument Interface front panel [24109122] (PCB, AUD $25.00)
  • USB Virtual Test Instrument Interface PCB pattern (PDF download) [24109121] (Free)
  • USB Virtual Test Instrument Interface front panel artwork (PNG download) [24109122] (Free)
Items relevant to "Digital Sound Effects Generator":
  • Sound Effects Generator PCB [09109121] (AUD $10.00)
  • PIC18F27J53-I/SO programmed for the Digital Sound Effects Generator [0910912A] (Programmed Microcontroller, AUD $20.00)
  • Firmware and C source code for the Digital Sound Effects Generator [0910912A] (Software, Free)
  • Digital Sound Effects Generator PCB pattern (PDF download) [09109121] (Free)

Purchase a printed copy of this issue for $10.00.

With this USB interface you can turn your desktop or laptop PC into a whole suite of test instruments – a 2-channel digital scope, spectrum analyser, AC DMM and frequency counter plus a 2-channel audio signal/ function/arbitrary waveform generator. Interested? Read on. By JIM ROWE Six test instruments in one tiny box . . . just add your PC! B ACK IN THE October 2011 issue we presented an article on testing audio gear using PC-based sound card instrumentation and featured the TrueRTA software package. This is capable of quite respectable results but does have a few limitations, mainly due to those of the sound card. In this article, we step up to a much more advanced set-up with a USB interface and a Windows-based audio testing package called Multi-Instrument 3.2, developed by Singaporebased firm Virtins Technology. This is a very professional software package and is reviewed elsewhere in this issue. The interface described here is a 40  Silicon Chip development of the USB Recording and Replay Interface described in June 2011 and uses the same USB CODEC. For those familiar with that design, the input channel circuitry has been changed to be more similar to that of an oscilloscope/analyser and the output channel circuitry changed to be more like that of an AF signal/function/ arbitrary waveform generator. Both the input and output channels have also been improved in terms of bandwidth, noise floor and crosstalk. How it works Since the heart of this project is the same Texas Instruments/Burr-Brown PCM2902 IC as in the June 2011 interface, we won’t give the detail of its operation. If you want to know more, refer to the June 2011 article which gives an internal block diagram and discusses its operation in detail. For our present purposes, it’s enough to know that the PCM2902 is a singlechip stereo audio CODEC with an inbuilt full-speed USB protocol controller, a serial interface engine (SIE) and a USB transceiver. It provides a pair of 16-bit ADCs (analog-to-digital converters) capable of working at seven sample rates between 8ks/s and 48ks/s and also a pair of 16-bit DACs (digital-to-analog converters) capable siliconchip.com.au INPUT A Vcc S1a INPUT BUFFER (IC1a) ANTI ALIASING LP FILTER (IC1b) ADC1 IN INPUT RANGE SELECT INPUT B S1b INPUT BUFFER (IC2a) ANTI ALIASING LP FILTER (IC2b) USB TO HOST PC ADC2 IN S/PDIF OUT STEREO Dout CODEC WITH USB SIE & TRANSCEIVER (IC3) Din S2a ANTI ALIASING LP FILTER (IC4a) OUTPUT BUFFER (IC4b) DAC1 OUT OUTPUT RANGE SELECT OUTPUT B SSPND Vbus D– D+ Dgnd S/PDIF INPUT OUTPUT A REG1 OUTPUT BUFFER (IC5b) S2b 12MHz ANTI ALIASING LP FILTER (IC5a) DAC2 OUT Fig.1: block diagram of the USB Virtual PC Instrument Interface. It’s based on a PCM2902 stereo audio CODEC with an inbuilt serial interface engine and USB transceiver. of working at three sample rates: 32, 44.1 and 48ks/s. The PCM2902 contains internal firmware which makes it fully compliant with the USB 1.1 standard and it installs automatically on Windows XP SP3 and later versions of Windows, using the USBaudio.sys drivers. Another nice feature of the PCM2902 is that it includes an output and an input for S/PDIF serial digital audio. It can process and analyse S/PDIF signals (from a DVD player or set-top box, for example), as well as being able to generate S/PDIF testing signals. The basic configuration of the new interface is shown in the block diagram of Fig.1. This shows the PCM2902 (IC3), with its USB port at upper right. The analog input and output circuitry is all to the left, with the two ADC inputs at upper left and the two DAC outputs at lower left. The S/PDIF input can be seen at centre left, while the S/PDIF output is shown at centre right. Each analog input channel has an input voltage divider and range switch which allows the input signals to be either passed straight through or attenuated to prevent overload. The input dividers and switches provide three input ranges for each channel: x1, x0.1 and x0.01. This allows the input channels to handle signals of 1.7V p-p (peak-to-peak), 17V p-p and 170V p-p, respectively. siliconchip.com.au An input buffer (IC1a & IC2a) follows the range switches in each input channel. These then feed the signals to anti-aliasing low-pass filters to remove any possible signal components above about 23kHz (which would cause aliasing). The outputs of the LP filters in turn feed into the two ADC inputs of the CODEC (IC3). The analog “generator” output channels are almost a mirror image of this configuration. The outputs of the DAC first pass through more anti-aliasing LP filters to remove any sampling “hash” and are each then fed to another voltage divider/switch combination to provide three output ranges: x1, x0.1 and x0.01, producing maximum output signal levels of nominally 0-2.12V peak-to-peak, 0-212mV p-p and 0-21.2mV p-p. The signals from the output range switches then pass through buffer stages IC4b & IC5b to the output connectors. So that’s the basic configuration. Now we can refer to the diagram of Fig.2 for the full circuit details. The input circuitry for channel A The unit is built into a diecast metal case which provides the necessary shielding. September eptember 2012  41 100 CHANNEL A INPUT CON1 1 F MKT 100nF Vcc 10 F 2.7k Vcc/2 K D1 1N4148 470k 2.2pF 430k 100 F 2.7k A IC1: MCP6022 S1a 1k 3 K 2x 180k D2 1N4148 2 8 IC1a 1 8.2k 15k 1nF 4 820pF A 33k 5 82pF 6 IC1b 1 F MKT 7 22 F* 22 F* 10k 100 Vcc/2 100nF 10 F S/PDIF IN CON3 100nF 100 INPUT RANGE SELECT (x0.01, x0.1, X1) 75 CHANNEL B INPUT 1 F CON2 MKT 100nF Vcc 10 F 390 K A D3 1N4148  LED1 A 470k K 2.2pF 430k S1b IC2: MCP6022 1k 3 K 2x 180k D4 1N4148 2 8 IC2a 4 1 8.2k 15k 1nF A 10k 82pF 5 6 SC 7 1 F MKT 22 F* 22 F* L1 220 H 10 F ANALOG GROUND 2012 IC2b 100 Vcc/2 100nF 820pF 33k Vcc/2 DIGITAL GROUND USB VIRTUAL PC INSTRUMENT INTERFACE Fig.2: the complete circuit diagram of the USB interface unit. IC1a & IC1b and IC2a & IC2b are the input buffers and low-pass filters for the Channel A and Channel B inputs, while IC4a & IC4b and IC5a & IC5b provide filtering and buffering for the output signals. IC3 is the stereo audio codec – it provides the ADC & DAC stages, generates the USB signals and handles S/PDIF input and output signals. is shown at upper left, while that for channel B is shown below it. Both channels are virtually identical, with channel A using the two op amps inside IC1 and channel B using those inside IC2. IC1 and IC2 are Microchip MCP6022 devices, selected because they offer impressive bandwidth, noise and distortion performance when operating from a relatively low single-supply voltage, which in our case is only 4V. The input signals from CON1 and 42  Silicon Chip CON2 are fed through 1µF DC blocking capacitors to the input dividers and the two sections of range switch S1. The signals selected by S1a and S1b then pass through 1kΩ current limiting resistors before being applied to the inputs of IC1a and IC2a, with diodes D1/D2 and D3/D4 used to limit the voltage swing at each input to a maximum of Vcc + 0.65V and a minimum of -0.65V. Note that since the pin 3 inputs of IC1 and IC2 are biased at Vcc/2 (ie, half the supply voltage), this allows the voltage swing to be over the full supply range. The outputs of LP filter stages IC1b and IC2b are each fed to the ADC inputs of IC3 (pins 12 & 13) via non-polarised coupling capacitors of approximately 12µF. These are made up from two series 22µF tantalum electrolytics connected in parallel with a 1µF metallised polyester capacitor. This has been done to extend the low-frequency response of the input siliconchip.com.au REG1 REG103GA-A Vcc (~4.0V) 2 A D5 1N5819 K 12 14 +3.6–3.85V 10 VcccI 5 HID0 6 HID1 7 HID2 AgndC SSPND VddI SEL1 VinL SEL0 DGND Vcom 10 F Vbus TANT D– 24 D+ Din DgndU VoutL 23 11 10 F TANT ADJ EN 5 28 27 9 1 F 8 2.2 3 Vcca 22 1 F 16 8.2k 15k 33k 82pF 820pF 22 F* 3 2 IC4a 22 F* 1 F 1 BOX & FRONT PANEL 100nF 30k S2a 3.0k 330 100 15 8.2k 1nF 1 F XTO XTI 19 15k 33k 820pF 18 22 2 IC5a 1 F 1 1M 100 Vcc/2 100nF 33pF 47 F 680 TANT CHANNEL A OUTPUT CON4 100k S/PDIF OUT CON6 220 110 100nF MKT 4 7 Vcca 30k S2b 20 X1 12MHz AgndX 82pF IC4b 22 F* 5 21 Vccp2I AgndP 22 F* 3 8 OUTPUT RANGE SELECT (x0.01, x0.1, x1) 150nF 25 5 6 10 F 100nF Vccp1I 4 MKT 4 VccXI VoutR 3 22 Vcc/2 17 1 2 4 1nF Dout TO HOST PC CON7 USB TYPE B 100 +5V 2 1 100 1.5k 26 IC3 PCM2902 VinR 1 F GND 3,6 IC4, IC5: MCP6022 13 +5V 1 13k 1 F 1 F 4 10nF 27k 100nF IN OUT 3.0k 330 6 8 IC5b 7 47 F 680 TANT CHANNEL B OUTPUT CON5 100k 10 F * 25V TANTALUM 27pF PCM2902 LED 1N4148 A K channels to an acceptable level, with the modest input impedance (30kΩ) of the ADC inputs. The S/PDIF input connector (CON3) is terminated via a 75Ω resistor. It is then connected to the digital input (pin 24) of IC3 via a 100nF coupling capacitor. The two analog output channels of the interface are shown at lower right in Fig.2, connected to the DAC outputs of IC3 (pins 16 & 15). Again, the two output channels are virtually siliconchip.com.au 1N5819 A K K A identical, with IC4a and IC5a providing the LP filtering and IC4b and IC5b forming the output buffers. IC4 and IC5 are again the same MCP6022 devices used in the input channels. The two sections of switch S2 are used for output range switching, in conjunction with their voltage dividers. As with the input channels, the outputs of IC4a and IC4b are coupled to their respective dividers via 12µF coupling capacitors, to achieve an acceptable low-frequency response. REG103GA-A 6 1 5 14 28 1 That’s also the reason for the 47µF capacitors used to couple the outputs of IC4b and IC5b to output connectors CON4 and CON5. The 680Ω resistors connected in series with each output provide short-circuit protection. The S/PDIF digital output of IC3 (pin 25) is coupled to output connector CON6 via a 150nF capacitor and two resistors, selected to give the S/PDIF output a source impedance very close to the correct value of 75Ω. As with the June 2011 Interface, the September 2012  43 1 F 1 F 1 F 10 F 100nF 1 F DGND 13k 15k 820pF 75 110 CON3 CON6 SPDIF SPDIF IN OUT 100k CON4 CHAN A OUT 3.0k 330 OUTPUT RANGE 10 F 680 + 100 IC5 MCP6022 33k 82pF 100 IC4 82pF MCP6022 22 F 22 F 100nF 100nF 150nF 220 CON2 CHAN B IN 22 F + + 47 F 100 K 3.0k 330 A + 1 F S2 100 390 180k 100 180k 430k 2.2pF 2.2pF 470k Dgnd + 27pF 33pF LED1 10k + 1 F 30k 1M + 8.2k 1nF 1k X1 + 100nF 22 F 1 F 12.0MHz + 15k 820pF 1 F + 33k 1nF 22 F + 470k CHAN A IN 5819 + IC3 PCM2902 VinB 10 F 100nF CON1 D5 10 F 8.2k 22 F 100nF 30k + 100nF + + VinB + INPUT RANGE 1 F 27k 22 F VinA + 1 F 24109121 C 2012 10nF 22 2 22 3 1 1.5k 100nF VinA 22 F + 33k IC2 MCP6022 D3 4148 1 F 82pF 4148 D4 1k Agnd AGND S1 10k 430k 15k 820pF 15k 820pF 100nF 33k IC1 8.2k 82pF 100nF 180k 180k 1nF 4 2.2 + MCP6022 D1 4148 100 + 4148 D2 10 F 2.7k 2.7k 100 100 10 F + + 220 H TOP 8.2k REG1 + 10 F 1nF 1 F USB (B) TO HOST USB VIRTUAL INSTRUMENT INTERFACE 100 F REG103 CON7 + 10 F 680 100k + 47 F CON5 CHAN B OUT Fig.3: install the parts on the PCB as shown here, starting with the surface-mount device IC3. Note that this layout shows the tracks on the top side of the PCB only; the tracks on the bottom have been omitted for clarity. USB port of the PCM2902 CODEC (IC3) connects to the USB host connector CON7 via the recommended component values. The power for all of the interface circuitry is derived from the Vbus pin (1) of CON7 but is connected to the rest of the circuit via REG1, a REG103GA low dropout (LDO) regulator which can be enabled or disabled via its EN input (pin 5). This is done so that the current drain of the interface can be switched down to a very low value when the host PC’s USB controller indicates to the CODEC’s serial interface engine (SIE) that it should drop into “suspend” mode. When the SSPND-bar output of IC3 (pin 28) rises to a high logic level to indicate the end of suspend mode, REG1 is turned on and delivers supply voltage (Vcc – approximately 4.0V) to the rest of the circuit – including the ADC and DAC circuitry inside IC3 44  Silicon Chip itself. This receives a supply voltage of around 3.8V, via Schottky diode D5. LED1 is driven from the Vcc line via a 390Ω resistor. LED1 indicates when the Interface has been activated (it remains off in suspend mode), as well as serving as a power-on indicator when the Interface is in use. L1 is used to provide a connection between the digital and analog grounds within the circuit – a connection which represents a low impedance at low frequencies but a higher impedance at high frequencies. This helps to keep digital hash out of the analog sections of the circuit and improves the overall noise performance. Construction All the parts used in the USB Interface are mounted on a double-sided PCB coded 24109121 and measuring 160 x 109mm. This fits inside a diecast aluminium box measuring 171 x 121 x 55mm (Jaycar HB-5046 or similar), to provide physical protection as well as effective shielding. The PCB is mounted on four M3 x 25mm tapped spacers behind the lid of the box. The spindles of switches S1 and S2 pass through matching holes in the lid, as does the body of LED1. USB connector CON7 is mounted at the rear of the PCB and when the PCB and lid are fitted to the box, CON7 is accessed via a rectangular hole in the rear. All of the other I/O connectors (CON1-CON6) are mounted along the front of the PCB, with the input sockets to the left and the output sockets to the right. These all pass through matching holes at the front of the box, when the PCB and lid are fitted. Hence, there is no wiring at all, apart from a single lead which connects the metal box to the earth of the PCB. Fig.3 shows the parts layout on the siliconchip.com.au This view shows the completed PCB, ready for installation on the case lid. Be sure to install the two switches with their spigots at 11 o’clock, as shown on Fig.3. PCB. You should follow it closely regarding the placement and orientation of the various components. Begin the PCB assembly by fitting the two SMD components, IC3 and REG1 (it’s easier to solder these in place when none of the other components are installed). Use a temperatureregulated iron with a fine chisel or conical point and hold each device in position carefully using a toothpick or similar tool while you tack-solder two pins that are well separated from each other. These will hold the device in position while you solder the rest of the pins; make sure that the originally tacked pins are properly soldered as well. Don’t worry if you accidentally create solder bridges between adjacent pins – these are almost inevitable and can be removed at the end of the soldering procedure using fine solder wick braid (an illuminated magnifier siliconchip.com.au is handy when it comes to checking for solder bridges). With IC3 and REG1 installed, you can fit the various passive components, starting with the resistors. These should be all 0.25W 1% metal film types, with the exception of the 2.2Ω unit just below CON7. This one needs to be a 0.5W or 0.625W type. Fit the 220µH RF inductor (L1) at this stage as well, just below CON7. Now fit the various capacitors. Make sure that you don’t confuse the 10µF tag tantalum types with the 10µF aluminium electrolytics and take care to fit all of these polarised components the correct way around. To help in this regard, Fig.3 shows the tantalum capacitors in brown, while the aluminium electros are shown as circles filled with pale blue. After all of the capacitors are in place you can install the 12MHz clock crystal for IC3, which fits just to the Table 1: Capacitor Codes Value 1µF 150nF 100nF 10nF 1nF 820pF 82pF 33pF 27pF 2.2pF µF Value 1µF 0.15µF 0.1µF .01µF .001µF NA NA NA NA NA IEC Code    1u 150n 100n   10n    1n 820p   82p   33p   27p   2p2 EIA Code 105 154 104 103 102 821   82   33   27    2.2 front of IC3 and alongside the 1MΩ biasing resistor. Next, install the 1N4148 diodes D1D4 which are located just to the left of the sockets for IC1 and IC2. The last diode to fit is D5 (1N5819) which goes midway between IC3 and REG1. The input and output connectors (CON1-CON7) are next. Then fit the 8-pin sockets for IC1, IC2, IC4 and IC5, taking care to orientate them with their notched ends towards the rear of the board as shown in Fig.3. September 2012  45 (LID OF 170 x 120 x 66mm DIECAST BOX) A A 73.5 73.5 42 49.5 49.5 CL 14 19 C C B 42 A A Fig.4: this is the full-size drilling template for the case lid. CL HOLES A ARE 3.0mm DIAMETER HOLE B IS 3.5mm DIAMETER HOLES C ARE 6.5mm DIAMETER 30 ALL DIMENSIONS IN MILLIMETRES 5 18 Fig.5: the drilling templates for the front and rear panels of the case. The square hole can be made by drilling a series of small holes around the inside perimeter, then knocking out the centre piece and filing the job to the shape. 13 14 9.5 C 15 (REAR OF BOX) CL 11 A A 23 B 23 UPPER LIP NEEDS TO BE FILED OFF ALONG FRONT OF BOX (SEE TEXT) 15 15 A A B 10 23 11 23 (FRONT OF BOX) HOLES A ARE 14mm DIAMETER 46  Silicon Chip HOLES B ARE 12mm DIAMETER HOLE C IS 3mm DIAMETER ALL DIMENSIONS IN MILLIMETRES siliconchip.com.au 4 M3 x 9mm SCREWS SWITCH SHAFTS PASS UP THROUGH 6.5mm DIAMETER HOLES (LID OF BOX) BOARD ATTACHED TO REAR OF LID VIA 4 M3 x 25mm TAPPED SPACERS 22 F 47 F + BNC INPUT & OUTPUT CONNECTORS + 4 M3 x 6mm SCREWS SUPPORT SPACER IN RIGHT REAR LOCKWASHER BETWEEN SOLDER LUG & PCB 22 F + USB TYPE B CONNECTOR PCB Fig.6 (above): this diagram shows how the PCB is secured to the back of the lid on four M3 x 25mm tapped spacers. The supplementary diagram at right shows how the PCB’s ground track is connected to the metal case via an earth wire and two solder lugs. The small metal lip that runs along the top front of the case must be filed away to allow the PCB & lid assembly to be slid into place. Switches S1 and S2 can now be installed. Before you fit them, their spindles should be cut to a length of 16mm so they’ll protrude through the front panel by the correct amount when the board assembly is fitted to it. The plastic spindles can be cut quite easily using a hacksaw and any burrs smoothed off using a small file. Then the switches can be fitted to the board. Orientate them as shown in Fig.3, with their spigots at 11 o’clock. Press them down firmly against the top of the PCB and then solder all of their pins to the pads underneath. Now try turning the switch spindles to check that they are correctly set for three positions. If not, you’ll need to first rotate each switch fully anticlockwise, then remove the nut and lockwasher before lifting up the stop pin washer and refitting it with the pin passing down into the correct hole (ie, between the moulded 3 and 4 numerals). Finally, refit the lockwasher and nut to hold everything in place. The final component is LED1, siliconchip.com.au located just below the centre of the board with its cathode “flat” towards the right. It is mounted in the upright position, with the lower surface of its body about 24mm above the top surface of the board. Just tack-solder one lead to hold the LED in place while the board is fitted behind the box lid. You will be able to adjust the height of the LED later, so that it protrudes nicely through the front panel. Both solder joints can be finalised then. The last step in completing the PCB assembly is to plug the four MCP6022 ICs into their sockets, each one with its notch end towards the rear of the board and also making sure that none of their pins become buckled. It’s also a good idea to earth yourself before handling them, because they can be damaged by electrostatic charge. Preparing the lid and the box Before the completed PCB assembly can be attached to the box lid, you’ll need to drill holes in the lid to match the screws for the mounting spacers. PCB BOX EARTHING WIRE RIGHT REAR CORNER OF BOX LOCKWASHERS ON EITHER SIDE OF SOLDER LUG In addition, you need to drill clearance holes for LED1 and the spindles of S1 and S2. The locations and sizes of all of these holes are shown in Fig.4, which is reproduced actual size so it can be used as a drilling template if you wish. As you can see there are only seven holes to be drilled in all, so preparing the lid is quite easy. The drilling diagram for the box is shown in Fig.5. Six holes need to be drilled using a pilot drill and then carefully enlarged to the correct size using a tapered reamer. The rectangular hole for USB connector CON7 can be made by drilling a series of small holes around the inside perimeter, then knocking out the centre piece and filing the job to the final rectangular shape. When all holes are complete, you will need to file away the small lip running along the top of the front of the box, as indicated by the note in Fig.5. This is necessary because when the lid and PCB assembly are being introduced into the box during final assembly, if the lip is still present it just prevents the front of the PCB from being lowered enough for BNC connectors CON1, CON2, CON4 and CON5 to pass through their matching holes. A professional front panel will be available for sale from the SILICON CHIP September 2012  47 PC Instrument Interface: Parts List 1 diecast aluminium box, 171 x 121 x 55mm (Jaycar HB-5046 or similar) 1 PCB, code 24109121, 160 x 109mm 1 front panel PCB, code 24109122 1 12.00MHz HC49U/US crystal (X1) 1 220µH RF choke, axial leads (L1) 2 4-pole 3 position rotary switches (S1,S2) 4 PCB-mount BNC connectors (CON1-CON2, CON4-CON5) 2 PCB-mount switched RCA sockets (CON3, CON6) 1 USB type-B connector, PCBmount (CON7) 4 8-pin DIL sockets, machined pin type 2 instrument knobs, 24mm dia. 4 M3 x 25mm tapped spacers 5 M3 x 9mm machine screws 4 M3 x 6mm machine screws 1 M3 nut 2 3mm solder lugs 3 3mm star lockwashers 1 120mm-length of insulated hookup wire Semiconductors 4 MCP6022 dual op amps (IC1,IC2,IC4,IC5) 1 PCM2902 audio CODEC (IC3) (Element14 8434700) 1 REG103GA-A low-dropout regulator (REG1) (Element14 1207256) 1 3mm high-intensity red LED (LED1) Partshop. This is basically a screenprinted PCB and is supplied with all the holes pre-drilled. Final assembly The PCB and lid assembly is shown in Fig.6. Four M3 x 25mm tapped spacers are attached to the rear of the lid using four M3 x 9mm machine screws (which also pass through the matching holes in the dress front panel, on the top of the lid). These screws should be tightened firmly, without causing buckling of the dress panel around the screw heads. Next, the PCB can be offered up to the lower ends of the spacers, taking care to ensure that the spindles of S1 and S2 align with their matching 48  Silicon Chip 4 1N4148 100mA diodes (D1-D4) 1 1N5819 1A Schottky diode (D5) Capacitors 1 100µF 16V RB electrolytic 2 47µF 16V tantalum electrolytic 8 22µF 16V tantalum electrolytic 6 10µF 16V RB electrolytic 2 10µF 16V tantalum electrolytic 6 1µF monolithic ceramic 6 1µF MKT polyester 1 150nF MKT polyester 10 100nF MKT polyester 1 10nF MKT polyester 4 1nF polyester (greencap) 4 820pF 50V disc ceramic 4 82pF 50V disc ceramic 1 33pF 50V NP0 disc ceramic 1 27pF 50V NP0 disc ceramic 2 2.2pF 50V NP0 disc ceramic Resistors (0.25W, 1%) 1 1MΩ 2 2.7kΩ 2 470kΩ 1 1.5kΩ 2 430kΩ 2 1kΩ 4 180kΩ 2 680Ω 2 100kΩ 1 390Ω 4 33kΩ 2 330Ω 2 30kΩ 1 220Ω 1 27kΩ 1 110Ω 4 15kΩ 8 100Ω 1 13kΩ 1 75Ω 2 10kΩ 2 22Ω 4 8.2kΩ 1 2.2Ω 0.5W 2 3.0kΩ Note: the PCB & front panel are available from the SILICON CHIP Partshop. holes in the lid and that the body of LED1 enters its own matching hole. Then when the PCB is resting on the spacers the complete assembly can be turned over and three M3 x 6mm screws installed to attach the board to three of the four spacers: the two at the front corners of the PCB and the one at the rear corner furthest from the USB connector CON7. When these three screws have been fitted and tightened up to hold the board and lid together, the final screw can be fitted in the remaining corner spacer hole. This M3 x 6mm screw is also used to terminate an earthing wire from the box – so in this case it must be fitted with a 3mm solder lug and a star lockwasher, before being screwed down against the exposed metal pad around this board mounting hole. Make sure you tighten this screw down securely, using a Phillips-head screwdriver and a spanner or small shifter to grip the spacer and prevent it from turning. Now check the positioning of LED1 in its hole in the front panel. Adjust it if necessary before soldering both its leads to the PCB. That done, you need to fit a 120mm long earth wire between the case and the PCB. This is attached at the case end via a 3mm solder lug that’s secured by an M3 x 9mm screw to one corner of the box. Fit a star lockwasher to the screw, then add the solder lug and follow this with another star lockwasher. The other end of the earth wire is soldered to the lug previously attached to one corner of the PCB. Once this wire is in place, remove the nuts from the front of the BNC input and output connectors (leaving the lockwashers in place) and lower the front of the lid and PCB assembly into the box until the BNC connectors pass through their matching holes in siliconchip.com.au Features & Specifications A 2-channel virtual test instrument USB interface to suit to any Windows-based PC, powered from the PC’s USB port. The two input channels and two output channels can all operate simultaneously. Also provided is an S/PDIF input and output. When used in conjunction with a suitable software package the interface allows the PC to be used as a 2-channel audio DSO and spectrum analyser combined with an AC DMM and a frequency counter, plus a 2-channel AF signal and function generator able to provide low-distortion sinewaves, a number of standard waveforms, white and pink noise, arbitrary waveforms and even DTMF signals and musical tones. Features of the Interface include: • • • Input channels provide three switched sensitivity levels – x1.0, x0.1 and x0.01 • • • Input impedance (both channels) is 1MΩ//20pF. • Frequency response of input channels is as follows: 21Hz – 8kHz +0/-0.15dB 12Hz – 12.6kHz +0/-0.5dB 6Hz – 16.3kHz +0/-1.0dB 1.5Hz – 20kHz +0/-2.0dB <1Hz – 22kHz +0/-3.0dB • • • Output channels provide three switched output levels – x1.0, x0.1 and x0.01. • • Output impedance (both channels) is 675Ω. • Frequency response of the output channels is as follows: 4.6Hz – 17.0kHz +0.15dB/-0.5dB 3.1Hz – 18.7kHz +0.15dB/-1.0dB 1.2Hz – 20.5kHz +0.15dB/-2.0dB <1Hz – 22.0kHz +0.15dB/-3.0dB • Crosstalk between channels, overall: below -62dB from 20Hz – 5kHz below -59dB from 1Hz – 10kHz below -56dB from 10kHz – 20kHz • Crosstalk between output and input channels: as for between channels shown above • THD+N for both channels, overall (ie, output-> input) for output/input levels of 0.5V RMS: at 100Hz, 0.075%; at 1kHz, 0.075%; at 5kHz, 0.1% Nominal input sensitivity (x1.0 range) is 500mV RMS (1.414Vp-p/-3.8dBu). Maximum input level (x1.0 range) before clipping is 600mV RMS    (1.70Vp-p/-2.2dBu). Effective noise floor of the input channels is at -99dBu (2.5µV). Two high-quality 16-bit ADCs capable of operating at sampling rates of 8, 11.025, 16, 22.05, 32, 44.1 and 48ksamples/s. The earth track of the PCB is connected to the metal case using a short earthing wire. This can be run to the right-rear of the case (not the left rear as shown here). the front of the box. This will then allow the rear of the lid/PCB assembly to be lowered into the box as well, until the lid is sitting comfortably on the top of the box. The lid can now be secured in place using four M4 screws (supplied with the box). Finally, refit the BNC connectors with their mounting nuts and then fit the knobs to the spindles of S1 and S2. Your Virtual Instrument Interface is now complete. Checkout time The only setting up adjustments you may need to make are in the operating system of the PC, as explained shortly. Checking out the Interface basically involves little more than connecting it to a spare USB port on either the PC itself or to a spare downstream port on an external hub connected to it. Because the PCM2902 CODEC includes firmware which identifies itself as a “Generic USB Audio CODEC”, it usually installs automatically as soon as you connect it to a PC running Windows XP (SP3), Windows Vista or Windows 7. siliconchip.com.au Nominal output level on the x1.0 range is 500mV RMS (1.414Vp-p/-3.8dBu). Maximum output level (x1.0 range) before clipping is 750mV RMS (2.12Vp-p/-0.28dBu). Two high quality 16-bit DACs capable of operating at sampling rates of 32, 44.1 and 48ksamples/s. • S/PDIF input and output both handle 16-bit stereo signals at sampling rates of 32, 44.1 and 48ks/s. • • Fully compliant with the USB 1.1 specification • Low current drain from PC via USB cable: less than 65mA Installs automatically on Windows XP SP3 and later Windows operating systems (plus Mac and Linux systems) using the standard USBaudio.sys drivers – no special or custom drivers required. • Fully compatible with Windows-based Virtual Instrument software such as Virtins MI 3.2 (standard and Pro versions). September 2012  49 Fig.7: the Windows 7 Sound dialog box. The default playback device should be the “USB Audio CODEC”. The PCB and lid assembly is slipped into the case as shown here. Don’t forget to file away the metal lip at the top front of the case. After a few seconds, you should hear a greeting from the PC’s sound system to indicate that the operating system has recognised that a new Plug and Play USB device has been connected. It then shows pop-ups from the System Tray as it identifies the device and automatically installs the standard USB audio drivers for it. LED1 on the Interface should also light as soon as the drivers are installed. The next step is to check that this has all taken place correctly. In Windows XP, click the Start button, launch the Control Panel and double click on “Sounds and Audio Devices”. This should bring up the Sounds and Audio Devices Properties dialog. If you then click on the “Audio” tab you should see “USB Audio CODEC” listed in the dropdown device selection lists for both Sound Playback and Sound Recording. This should also be the case if you click on the “Voice” tab. Now click on the “Hardware” tab and select “USB Audio Device”. You should see the following information in the Device Properties area: Manufacturer: (Generic USB Audio) Location: Location 0 (USB Audio CODEC) Device Status: This device is working properly. If you are using Windows 7, launch the Control Panel and select “Hardware and Sound”. Then double-click on “Sound”, which should bring up the dialog box shown in Fig.7. The “Playback” tab will be automatically selected, showing that the default playback device (labelled “Speakers”) is the “USB Audio CODEC”. If you then select the Recording tab, this should show that the default recording device (labelled “Microphone”) is again the USB Audio CODEC, as shown in the upper dialog in Fig.8. If you then click on the Microphone to select it and then click on the Properties button, this will open up the Microphone Properties dialog (the lower one in Fig.8), to confirm that These two scope grabs show waveforms generated by the Virtins’ Multi-Instrument 3.2 software and processed through the Virtual PC Instrument Interface. A 10kHz sinewave is shown at left, while at right is a 100Hz square wave. 50  Silicon Chip siliconchip.com.au Fig.8: the default recording device (left) should again be shown as the “USB Audio CODEC”. Clicking the Properties button then bring up the dialog shown below. Fig.9 (above): selecting the Levels tab in Fig.8 brings up this dialog box. The Microphone slider control should be dragged to the left to give a level reading of “4” (see text). the Interface is installed as a Generic USB Audio device. Finally, you need to select the Levels tab at the top of the Microphone Properties dialog. This will display the Microphone mixer level control slider, as shown in Fig.9. Move the slider towards the lefthand end until the number displayed in the box to its right is “4” (see Fig.9). This is the correct setting for our Virtual Instrument Interface, because the PCM2902 leads Windows to believe it is providing amplified signals from two microphones when it’s really providing “line level” inputs. By setting the slider to “4”, we trick Windows into believing the signals are effectively coming from line level inputs. Once you have set the “Microphone” slider to 4, all that is necessary is to back out of these dialogs by clicking on the “OK” buttons in turn until you return to the Control Panel. The USB socket is accessed via a square hole in the rear side panel of the case. Note that the case lid is held on using just four screws (one at each corner). The other two holes in the lid are covered by the front panel and are not used. This can then be closed and your Virtual Instrument Interface will now be installed and ready for use. Of course before you can do so, you’ll need to install the Virtual In- strument Software you’re planning to use with it. For details on installing and using Virtins’ Multi-Instrument 3.2 please refer to the review article SC elsewhere in this issue. PCM2902 Version Differences The PCM2902 IC specified in this project (and the USB Stereo Recording/Playback Interface from July 2011) is the most common type currently available in Australia. However, Texas Instruments also has two newer versions of this chip: the PCM2902B and PCM2902C. All three versions are pin-compatible and should work without any circuit changes. The later versions have some minor advantages: (1) the B and C versions are USB 2.0 compliant whereas the original is only USB 1.1 compliant; (2) the original chip had a one-sample recording delay between the left and right channels which has been fixed in the later revisions; and (3) the later versions are more tolerant of malformed S/PDIF input data. In addition, the PCM2902C identifies its analog inputs as line level inputs rather than microphone inputs, so you don’t have to adjust the input gain before using it. It also has an onboard digital volume control. siliconchip.com.au September 2012  51