Silicon ChipDSP Active Crossover and 8-channel Parametric Equaliser - May 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: “Crippleware” possibly to blame for two airliner crashes
  4. Feature: Avalon Airshow: from killer drones to spacecraft! by Dr David Maddison
  5. Project: DSP Active Crossover and 8-channel Parametric Equaliser by Phil Prosser and Nicholas Vinen
  6. Feature: El Cheapo Modules: Class D amplifier modules by Allan Linton-Smith
  7. Project: Solar-powered data repeater for 433MHz remotes by John Clarke
  8. Serviceman's Log: Samsunk – or the dishwasher that wouldn’t by Dave Thompson
  9. Project: Bridge adaptor gives four times your amplifier power! by Nicholas Vinen
  10. Review: Microchip’s new “SNAP” debugger/programmer by Tim Blythman
  11. Project: Low-cost 3.5-inch LCDs for Arduino or Micromite by Tim Blythman
  12. Vintage Radio: Admiral 1956 5ACW Clock Radio by Associate Professor Graham Parslow
  13. Product Showcase
  14. PartShop
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: Multi Diode Curve Plotter, March 2019; DAB+/FM/AM Radio, January-March 2019; 3-Way Adjustable Active Stereo Crossover, September-October 2017
  18. Outer Back Cover: Hare & Forbes Machineryhouse

This is only a preview of the May 2019 issue of Silicon Chip.

You can view 46 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:
  • The Avalon 2013 Air Show (May 2013)
  • The Avalon 2013 Air Show (May 2013)
  • The Australian International Airshow 2015 (May 2015)
  • The Australian International Airshow 2015 (May 2015)
  • Avalon Airshow: from killer drones to spacecraft! (May 2019)
  • Avalon Airshow: from killer drones to spacecraft! (May 2019)
  • Avalon Airshow 2023 (May 2023)
  • Avalon Airshow 2023 (May 2023)
Items relevant to "DSP Active Crossover and 8-channel Parametric Equaliser":
  • DSP Crossover CPU PCB [01106193] (AUD $5.00)
  • DSP Crossover LCD Adaptor PCB [01106196] (AUD $2.50)
  • DSP Crossover front panel control PCB [01106195] (AUD $5.00)
  • DSP Crossover DAC PCB [01106192] (AUD $7.50)
  • DSP Crossover power supply PCB [01106194] (AUD $7.50)
  • DSP Crossover ADC PCB [01106191] (AUD $7.50)
  • DSP Active Crossover complete PCB set (7 boards) [01106191-6] (AUD $40.00)
  • PIC32MZ2048EFH064-250I/PT programmed for the DSP Active Crossover/Equaliser (V8) (Programmed Microcontroller, AUD $30.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 128x64 Blue LCD screen with KS0108-compatible controller (Component, AUD $30.00)
  • Firmware and source code for the DSP Active Crossover/Equaliser project [0610619A.HEX] (Software, Free)
  • DSP Active Crossover/DDS/Reflow Oven PCB patterns (PDF download) [01106191-6] (Free)
Articles in this series:
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (May 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser, part two (June 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
  • DSP Active Crossover and 8-channel Parametric Equaliser (July 2019)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Solar-powered data repeater for 433MHz remotes":
  • 433MHz Wireless Data Range Extender PCB [15004191] (AUD $10.00)
  • PIC16F88-I/P programmed for the 433MHz Wireless Data Range Extender [1500419A.HEX] (Programmed Microcontroller, AUD $15.00)
  • 23LCV1024-I/P SRAM and MCP73831T charger IC for the 433MHz UHF Repeater (Component, AUD $12.50)
  • Firmware and source code for the 433MHz Wireless Data Range Extender [1500419A.HEX] (Software, Free)
  • 433MHz Wireless Data Range Extender PCB pattern (PDF download) [15004191] (Free)
  • 433MHz Wireless Data Range Extender lid panel artwork (PDF download) (Free)
Items relevant to "Bridge adaptor gives four times your amplifier power!":
  • Amplifier Bridge Adaptor PCB [01105191] (AUD $5.00)
  • Amplifier Bridge Adaptor PCB pattern (PDF download) [01105191] (Free)
  • Panel artwork for the Bridge-mode Audio Amplifier Adaptor (Free)
Items relevant to "Low-cost 3.5-inch LCDs for Arduino or Micromite":
  • Low-cost 3.5-inch LCD Adaptor PCB for Arduino R3 [24111181] (AUD $5.00)
  • 3.5-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $35.00)
  • Sample software and source code for low-cost 3.5-inch LCDs for Arduino and Micromite (Free)
  • Low-cost 3.5-inch LCDs Adaptor for Arduino R3 boards PCB pattern (PDF download) [24111181] (Free)

Purchase a printed copy of this issue for $10.00.

Is it a Digital Signal Processor? Is it a Two-way Active Crossover? Is it an Eight-channel Parametric Equaliser? IT’S ALL OF THESE... But wait: there’s MORE!! There’s a wide range of audio processing tasks this project can handle. Yes, it uses DSP to provide an 8-channel parametric equaliser, so you can adjust frequency response to exactly the way YOU want it with really low distortion and noise. Or you can use it to “Biamplify” a pair of speakers. Or you can simply use it to experiment with any audio signal. And with its modular design it’s even ready for future expansion. L et’s face it: most tone controls don’t give you a huge amount of control! Sure, you can boost or cut the treble and bass – but only centred on particular frequencies. Sure, you can adjust the level between channels. But that’s just about it. Wouldn’t you like to have TOTAL control over your sound system? You need this active crossover/DSP/Parametric Equaliser. It simply slots in between your sound source (no preamp required) and your amplifier (if your amp has tone controls, simply leave them “flat”). We’ve published active crossovers before (the latest in September & October 2017), and DSP-based projects before (October 2014), but this is the first time we’ve combined both concepts. This is also the first time that we’re publishing a digital signal processor that’s truly high fidelity, as it has a very low total harmonic distortion figure of around 0.001%. This unit takes a stereo audio signal and splits it up into two separate audio signals, with two output channels containing only the high frequencies and the other two, the low frequencies. These can then be fed to separate stereo amplifiers, with one amplifier driving the tweeters and the other driving the woofers. The signals combine in the air to give an accurate reproduction of the original audio signal. This avoids the need for passive crossover circuitry, which can reduce sound quality, and allows for higher total power output, due to each amplifier only having to handle part of the audio signal. It can be tweaked to perfectly suit the drivers and cabinet used, as DSP allows for the crossover parameters to be set precisely and identically between the left and right channels. Design by Phil Prosser . . . Words by Nicholas Vinen 26 Silicon Chip Australia’s electronics magazine siliconchip.com.au Since the chip is already processing the digital audio data, we’ve also provided some parametric equalisation, so that you can modify the frequency response of the unit to compensate for any deficiencies in your drivers, cabinet, placement, room etc. Basically, you can tweak the sound profile to be exactly the way you like it, and without any further degradation to the audio signal, since it’s only converted from analog to digital and back to analog once, no matter how much additional processing is done in the digital domain. Features & specifications • Low distortion and noise: ~0.001% THD+N • One stereo input, two stereo outputs (low/high), weird optional channel inve rsion • Each pair of outputs can be crossed over using first, second or fourth-order digit al filters • Additional parametric equalisers: four, common to all outputs • Optional high-pass filter for low-frequ ency outputs, to cut out subsonic frequ encies • Configurable delay for each channel, to compensate for driver offsets (up to 6.2m ; 18ms) • Individually configurable output inve rsion and attenuation settings • Built-in volume control – no need to use a preamp • Load and save setups to EEPROM • Software written in Microchip C; coul d be adapted for other DSP uses (open source) What the Active Crossover does Fig.1: this two-way active crossover splits a signal with a spectrum covering the entire audible frequency range into two signals, one with the components above the crossover frequency and the other, the components below it. The optional woofer high-pass filter removes subsonic signals. Fig.1 shows what the unit does. This shows the spectrum of an audio signal, with the frequency increasing left-to-right, from the lowest frequency that we can hear to the highest. The level of each component of this signal is shown in the vertical axis. The blue area shows the signals which are extracted from the input to be sent onto the tweeter, while the mauve area shows those which go to the woofer. Signal components which fall in the crossover zone in the middle go to both outputs, although at reduced levels, so that they add up in such a way to give the original signal levels. Since this active crossover is adjustable, you can set the crossover frequency to be at the ideal point for your loudspeaker. You can also adjust the steepness of the roll-off, as shown by the dotted lines, as different roll-off rates suit different situations. There’s also an optional subsonic filter, so that very low (inaudible) frequencies, or those which are too low for the woofer to reproduce, are eliminated and do not waste your amplifier power or possibly damage your woofer. Its frequency is also adjustable. (This is essential for vented, horn loaded and infinite baffle speakers). The relative levels of the woofer and tweeter can also be adjusted, to compensate for differing driver efficiencies or amplifier gains, and although it isn’t shown on the diagram, you can also delay one channel slightly relative to the other, to give proper ‘time alignment’. The four parametric equalisation channels are not shown in Fig.1, but essentially, each can be configured as either a high-pass or low-pass filter with adjustable stopband attenuation and corner frequency. This allows you to ‘shelve’ frequencies above or below a specific frequency, or between or outside a pair of frequencies, to shape the overall frequency response at all four outputs. The Active Crossover is used as shown in Fig.2. It’s connected between the stereo outputs of a preamp and four power amplifiers which power the four loudspeaker drivers independently. Note that you don’t need to use a preamplifier as this Active Crossover has a built-in volume control, so you can use it as a basic preamp too. In that case, the signal source is connected directly to the Active Crossover’s inputs. Why use an active crossover? There are a few reasons why you may want to use an active crossover. Firstly, if you are building speakers from scratch, it’s probably easier to use an active crossover than Fig.2: here’s how the Active Crossover forms part of a bi-amplified hifi system. The preamplifier is optional in this case since this Crossover has a built-in volume control. siliconchip.com.au Australia’s electronics magazine May 2019  27 Fig.3: the Active Crossover is built from a modular DSP system. It uses seven boards: one stereo ADC, two stereo DACs, a CPU board, LCD, power supply/ routing module and front panel control board. design a passive one, since you can easily experiment with it and change the crossover frequency/frequencies, relative amplitudes and so on until it sounds ‘right’. Also, if you’re building a seriously powerful system with big amplifiers and big speakers, it’s difficult to design a passive crossover to handle all that power. Since an active crossover is connected before the amplifiers, and the amplifiers can then power the drivers with nothing in between, efficiency is maximised and you can deliver as much power as your amplifiers and drivers can handle. Depending on the speaker design, you may also wind up with better overall sound quality using an active crossover than a passive one. Partly this is because it’s hard to create a very ‘steep’ passive crossover, which crosses over across a small frequency range, but this is relatively easy to do with an active crossover. Also, when using an active crossover, especially a digital one, because you have separate line-level signals for the tweeters and woofers, it is possible to compensate for the slightly different distance from each diaphragm to the listener by delaying one of the signals. The exact delay required depends on the driver and cabinet design; it’s tough to achieve perfect ‘time alignment’ mechanically, so being able to adjust this electronically is a boon. 28 Silicon Chip Another advantage of an active crossover is that if you drive the system into clipping, usually this will be due to a huge bass signal. With a single amplifier for each of the left and right channels, that means that the treble signal will be clipped off entirely each time the bass signal hits one of the rails. That can sound really bad. But with bi-amplification, even if you’re clipping the bass signal, since most of the treble is going through a separate amplifier, it won’t be affected. The result will still not be ideal, but won’t sound anywhere near as bad; be thankful for small mercies! Basically, except for the extra complexity that comes with the use of an active crossover, there are only benefits to this arrangement. It’s much easier to adjust and tweak to give near-ideal sound quality, has minimal effect on signal quality or speaker power handling and can be adapted to any twoway loudspeaker system, as long as you can wire up each driver separately. Modular design This DSP Crossover is built by combining several different modules, each with a specific function. It was designed this way so that it could be reconfigured to do many different audio DSP tasks. In fact, with the same hardware but different software, it could be used for a variety of audio processing tasks such as echo/reverb/ effects, equalisation, delay and so on. Australia’s electronics magazine The basic configuration is shown in Fig.3. It uses seven main boards: one stereo analog-to-digital converter (ADC) board, two stereo digital-toanalog converter (DAC) boards, a microprocessor board, a power supply/ signal routing board and a front panel interface board. These are rounded out with a graphical LCD module for display, and a mains transformer to power it. Interconnections are made between the boards with ribbon cables fitted with standard insulation displacement (IDC) connectors. This is a convenient and easy way to join boards where multiple signals and power need to be routed between them. Audio signals are fed into the unit via the ADC board where they are converted to digital data. This data passes through the power supply/routing board and onto the microcontroller, which stores it in RAM before doing whatever processing is necessary. It then feeds this data back out through a different set of pins, again as serial digital audio data, where it passes back through the routing board and onto one (or both) of the DAC modules. The DAC modules then convert these digital signals back into linelevel analog signals which are available from two RCA connectors on the rear panel. The microcontroller board is wired directly to the graphical LCD, so it can show the current status and provide the user interface, while the separate front panel control board connects to the micro via the routing board, allowing the user control over that interface. The whole thing is powered from a 9V transformer, which could be a plugpack or mains type. If a mains transformer is used, it would generally be an 18V centre-tapped (9-0-9V) type, to give full-wave rectification. But half-wave rectification, as would be the case with most plugpacks (as they usually have a single secondary winding), is good enough. Circuit description Let’s start with the place where the audio signals enter the unit, the ADC board. The circuit diagram for this board is shown in Fig.4. It’s built around an ultra high-performance ADC, the CS5361 (IC1), which has a dynamic range of 111dB and a typical THD+N figure of 0.001%. There is a compatible alternative, siliconchip.com.au Fig.4: the circuit of the ADC board. The two single-ended input signals are filtered and converted into balanced signals, then fed into analog-to-digital converter chip IC1. Its digital output signal is fed to a ribbon cable via CON2 and onto the microcontroller DSP board. the CS5381, which offers even lower distortion. The stereo line-level audio signals are fed in via RCA sockets CON1a & CON1b. They pass through ferrite beads with 100pF capacitors to ground, both intended to remove any RF signals, either from the signal source or picked up in the connecting leads. As the two channels are processed identically before they reach the inputs of IC1, we’ll just describe the left channel path. The audio signal is then AC-coupled to non-inverting input pin 3 of op amp IC2a, an NE5532 low-noise, low-distortion device. Schottky diodes D1 and D2 prevent excessive voltages from being applied to this op amp, eg, inductive spikes generated by lightning or from incorrectly connected equipment. A 100kresistor to ground provides a path for 30 Silicon Chip direct current to flow out of that input pin. IC2a buffers the signal, providing a low-impedance source for the following filters. The signal is then fed to op amp IC2b, an inverting amplifier with a gain of -1, due to the use of two resistors of the same value in the feedback network. A 33pF capacitor across the resistor between pins 7 (output) and 6 (inverting input) rolls off the ultrasonic frequency response to provide stability. The reason for this inverting stage is that the ADC chip (IC1) is a differential design, so for both the left and right channel inputs, it expects two signals, one 180º out of phase with the other. The in-phase signal comes from the output (pin 7) of IC2b, while the out-of-phase signal is taken di- Australia’s electronics magazine siliconchip.com.au rectly from the output (pin 1) of the preceding buffer, IC2a. It may seem odd that the in-phase signal comes from the output of the inverter, but this is because the following filter stages are also inverting, so it will end up with the same phase as the inputs, while the other signal will be out of phase. Both signals are then fed through identical buffer/filter arrangements, built around IC4a and IC4b. These filters are similar to what is recommended in the CS5361 data sheet (Figure 24), but not exactly the same. The data sheet says: “The digital filter will reject signals within the stopband of the filter. However, there is no rejection for input signals which are (n×6.144 MHz) the digital passband frequency, where n=0,1,2, … Refer to Figure 24 which shows the sugsiliconchip.com.au gested filter that will attenuate any noise energy at 6.144 MHz, in addition to providing the optimum source impedance for the modulators.” The main difference between our circuit and the recommended circuit is that ours is inverting. While inverting amplifiers introduce more noise than non-inverting amplifiers, inverting amplifiers can have lower distortion due to their near-zero common mode voltage. Also, the use of inverting amplifiers allows us to easily provide a slightly different DC bias to the two signals. This is done one by connecting a low-value resistor (8.2) between the non-inverting input pins (pins 3 & 5) of op amps IC4a/IC4b, which are in series with a divider across the supply rail (10k/10k). Australia’s electronics magazine May 2019  31 Fig.5: the DAC board does the opposite of the ADC board, converting the digital audio signals from the microcontroller back to balanced analog signals, then converting these to single-ended audio signals so they can be fed to stereo RCA output connector CON4. The reason for DC biasing the two differential inputs differently is to overcome a potential problem with analogto-digital converters, that when the signal is near the ‘zero point’, the binary values at the output tend to flip between all zeros and all ones. This can cause digital noise at the worst possible time – when there is near silence at the inputs. By adding a slight DC offset, the zero point is moved such that any small amount of noise will only cause a few bits to flip. That offset is removed by digital filtering inside the ADC chip. While modern delta-sigma ADCs do not suffer from this problem anywhere near as severely as early ADCs, this solution is cheap insurance to guarantee that the bit flipping problem does not affect us. The bottom end of the divider which produces the halfsupply bias rails is bypassed with 10µF and 100nF capacitors, to reject any noise and ripple that may be on this rail and prevent it from getting into the signal path. The ADC runs from its own regulated 5V rail which should be pret32 Silicon Chip ty ‘quiet’. But this is a very high-performance ADC, so it isn’t worth taking any risks in feeding noise into its inputs. The 91series resistors at the op amp outputs protect the ADC from excessive voltages. The op amps run from ±9V while the ADC runs from 5V, so the op amps outputs can swing beyond both of the ADC supply rails. But since the op amp feedback comes from after this resistor (ie, it’s inside their feedback loops), the output impedance is still very low, and the frequency response is flat. Schottky diodes D5, D6, D9 & D10 help to further protect the ADC inputs, by conducting if the op amps try to drive the ADC inputs below -0.3V or above +5.3V. This prevents any standard silicon devices (eg, transistors or diodes) inside IC1 from conducting due to an excessive input voltage, as usually this will only happen once the applied voltage is more than 0.6V beyond the supply rails. The 91resistors also combine with a 2.7nF capacitor across the differential inputs of IC1, to provide some further Australia’s electronics magazine siliconchip.com.au differential filtering, to keep out any signals at 6.144MHz or above (the ADC’s internal clock rate), which could affect the signal quality through aliasing. Analog to digital conversion The stereo differential signals are applied to input pins 16, 17, 20 & 21 of IC1. There are some extra components connected to this IC, which are required for its correct operation. It has two internal reference voltages, which are fed to pins 22 (VQ or quiescent voltage) and 24 (FILT+) and these need to be externally bypassed to ground via capacitors. We have provided two capacitors to filter each of these rails, 10nF in both cases, plus 220µF for FILT+ and 1µF for VQ. The use of two different values provides a lower impedance across a broader range of frequencies. IC1 has three different supply pins: VA (pin 19) for the analog 5V supply, VD (pin 6) for the digital 5V supply and VL (pin 8) for the 3.3V logic/interface supply. The supply siliconchip.com.au arrangement is described below. Pin 1 is IC1’s reset input, and this is connected to the logic supply via a diode and resistor, and to ground via a capacitor. This forms a power-on reset circuit. Initially, the capacitor is discharged and so the reset input is low, resetting IC1. This capacitor then charges up via the 10kresistor and releases reset after a few milliseconds. When power is switched off, the capacitor rapidly discharges via D13. This reset pin is also connected to pin 2 of CON2, which is routed to the microcontroller, so it can reset IC1 after power-up if necessary. Pin 2 selects either master mode (when high, ie, IC1 drives the digital audio clock lines) or slave mode (when low, ie, IC1 is clocked externally). This is connected directly to ground since the audio clock signals are supplied from the microcontroller via pins 12, 14 and 16 of CON2. These connect to pins 5, 3 and 4 of IC1 respectively, and in slave mode, these are the clock inputs. Australia’s electronics magazine May 2019  33 Here’s how to insure your investment in SILICON CHIP: Silicon Chip Binders We use them ourselves here at SILICON CHIP! Keep your collection of your favourite magazine intact, protected and most of all, where you can lay your hands on it! H Heavy board covers with dark green vinyl covering H Each binder holds at least 12 issues H SILICON CHIP logo printed in gold-coloured lettering on spine and cover Price: $A19.50 [including GST. P&P extra] (Australia only; not available elsewhere). ORDER ON LINE: WWW.SILICONCHIP.COM.AU/SHOP or ORDER BY PHONE: (02) 9939 3295 [9-4, Mon-Fri] Pin 5 (MCLK) is the master (oversampling) clock, which is typically around 12.288MHz, ie, 48kHz x 256. This is used to clock the ADC modulator and other internal circuitry. Pin 3 is the left/right clock or sample clock, and this is usually at around 48kHz. When it is high, the serial data pin is normally carrying left audio channel data when it is low, right audio channel data. Pin 4 is the sample clock and this clocks the serial data itself. It usually operates at the sampling rate times the number of channels, eg, 48kHz x 2 = 96kHz. The serial data comes from pin 9 of IC1 and goes to pin 18 of CON2, where it eventually feeds into the microcontroller. Note that pin 5 (MCLK) of IC1 has a snubber network connected to ground. This is intended to prevent ringing and is a good idea when a high-frequency signal is fed through a long wire, however, at 12.288MHz it was found not to be necessary, and so those components can be safely left off. ADC configuration Pins 10-14 of IC1 are configuration inputs and their state determines how the ADC operates. Pin 10 (MDIV) causes the master clock signal to be divided by two when high, allowing a higher frequency master clock to be used. Pin 11 enables or disables a digital highpass filter, to remove any DC offset from the input signals. Pin 12 selects the digital audio output data format, either I2S or left-justified. Pins 13 & 14 select the sampling rate range, either singlespeed mode (2-51kHz, M0 & M1 low), double-speed mode (50-102kHz, M0 high) or quad-speed mode (100-204kHz, M1 high). Of these five pins, pin 12 (I2S/LJ) is tied to VL via a 10kresistor, permanently selecting I2S format. The other four connect to jumpers JP1-JP4 and have 10kpull-ups to VL. So they are high by default but can be pulled low by placing a shorting block on the jumper. Typically, all four jumpers are fitted, so that master clock division is disabled, the high-pass filter is enabled and the sampling rate can be 48kHz. But the use of jumpers means that you could change the software (eg, to use a higher sampling rate) and easily reconfigure the ADC board to suit. Pin 15 of IC1 goes low if either input signal swings out34 Silicon Chip side the range that the ADC can cope with. We have an LED (LED1) connected to this pin, with a 1kcurrent-limiting resistor to VL. So LED1 will light if the input signal level is too high for IC1 to cope with, resulting in digital clipping. Power supply rails The 5V analog supply comes from the output of an MC33375D low-dropout regulator, REG1, which is fed from the incoming +9V supply via a ferrite bead (FB3). This regulator was chosen for its very tight line and load output specifications (2mV and 5mV respectively), which means that the resulting analog 5V rail should be very stable indeed. REG1 has 100nF and 220µF input bypass and output filter capacitors, but there are also four bypass capacitors right near IC1’s VA input pin: 10nF, 100nF, 1µF and 10µF. Again, these different values were paralleled to provide a very low supply source impedance for IC1 across a wide range of frequencies, from a few hertz up to many megahertz. The 5V digital supply, VD, is powered from the same 5V rail as VA but with a 5.1resistor in between so that digital noise does not feed back into the analog supply. The VD rail has a separate 10nF bypass capacitors for high-frequency stability. The 3.3V logic supply comes from pin 20 of interface header CON2, via another ferrite bead (FB6) and is bypassed with 10nF, 100nF and 1µF capacitors. The ±9V supply rails for the op amps (also used to derive the 5V rails) are fed in via pins 24 & 26 of box header CON2, with series ferrite beads to stop RF signals from propagating in either direction. This is important since long unshielded ribbon cables can pick up all sorts of EMI. Microcontroller interface CON2 carries the power supply, control and digital audio signals. It’s a 26-pin DIL header which connects to a ribbon cable. By tying all odd numbered pins to ground (except for pin 25), every second wire in the ribbon cable is grounded, minimising interference between adjacent signals on the even-numbered pins. As previously mentioned, pins 20, 24 & 26 provide power to the ADC board while pins 12, 14, 16 & 18 carry the clock signals and digital audio data, and pin 2 is the reset line. Pins 22 & 25 are unused, leaving pins 4, 6, 8 & 10 which are reserved for an SPI control bus. But IC1 does not have an SPI control interface, so those pins are not routed anywhere on this board. DAC circuitry Now let’s turn our attention to the DAC board circuit, shown in Fig.5. Essentially, its job is the opposite of the ADC circuit shown in Fig.4. Rather than turning two analog audio signals into digital data, this circuit takes digital data and produces two lowdistortion analog audio signals. DIL header CON3 is another 26-pin header and it uses essentially the same pinout as CON2 in Fig.4. As before, odd numbered pins other than pin 25 are tied to ground. Pins 20, 22, 24 & 26 supply power to the DAC module while pin 2 is reset, pins 4, 6, 8 & 10 are the SPI control bus and pins 12, 14, 16 & 18 carry the digital audio clocks and data. As with the ADC board, there is a snubber on the MCLK line (at pin 6 of IC6), but this is not strictly necessary and can be omitted. Also, there is no automatic reset network Australia’s electronics magazine siliconchip.com.au Fig.6: the power supply board has a bridge rectifier (D17-D20) plus five linear regulators and powers all the rest of the circuitry from the 9V AC or 9-09V AC fed to CON13. It also routes all the signals between the ADC, DAC and PIC32 boards via CON14CON19. siliconchip.com.au Australia’s electronics magazine May 2019  35 on pin 13 of IC6; instead it is merely pulled up to VD (3.3V) via a 10kresistor and connected to pin 2 of CON3. So the micro must forcibly pull this pin low to reset IC6. The digital audio data is fed straight to pins 3-6 of IC6. While this chip does have an SPI control interface on pins 9-12, it can also be operated without it. This ‘hardware mode’ is selected by keeping pin 9 (control data input) at a DC level for a certain period after reset. In this case, pins 9-12 become control inputs. That is how it is being used here. Pin 12 (M0) is pulled high via a 10kresistor to the VLC (logic supply) pin while the other three pins (M1-M3) are connected to ground via 10kresistors. This selects single-speed (32-50kHz sampling rate) I2S mode without digital de-emphasis. Like the ADC, DAC chip IC6 needs external filter capacitors for two internal reference rails, and these are connected between pin 15 (FILT+) and ground, and pin 17 (VREF) and ground. Analog audio appears at pins 19, 20, 23 & 24. As with the ADC, these are differential signals. They are AC-coupled using 100µF capacitors with 100kbiasing resistors to remove the DC component of the output signals. They are then fed to third-order (-18dB/octave) active low-pass filters built around low-distortion LM4562 dual op amps IC7 and IC8. These filters are different from the recommended filter in the CS4398 data sheet, but they have the same purpose: to remove the high-frequency delta-sigma switching artefacts from the analog audio signals. These filters have a -3dB point of 30kHz and are down to -90dB by 1MHz. But the response is down by only around 0.3dB at 20kHz, with a very flat passband, so has minimal effect on audio frequency signals. The differential output from the two pairs of identical filters is fed into a differential amplifier which provides further filtering, based around either IC9a or IC9b. This also converts them to single-ended signals. These stages provide some gain, to boost the ~1V RMS from the DAC up to around 2.3V RMS, a similar level to that produced from many other audio sources like CD/DVD/ Blu-ray players The signals are then AC-coupled by 22µF capacitors and DC-biased to ground using 10kresistors, to remove any remaining DC bias on the signals. They are then fed to the inputs of IC10, a PGA2320 volume control chip. There are two things to note about this chip. One is that we’re feeding the left channel signal to its right channel input and the right channel signal to its left channel input. But that doesn’t matter since its channels are independent. The other is that the CS4398 already has a built-in digital volume control. IC10 is included on the board because it adds little noise to the signal and since the signal swing is higher at the outputs, we thought that this would introduce less distortion. And that is true, but the effect is quite small, so we didn’t even bother wiring up the control signals from IC10 to the microcontroller. So you can leave it off the board and instead, solder 0resistors from its pin 9 pad to pin 11, and another from pin 16 to pin 14, so that the signals from IC9 go straight to the output RCA connectors, CON4. While it may seem odd that there’s a footprint for IC10 when it isn’t connected to the microcontroller, it could be useful if the board was used in a different project, and there was space on the board, so we’ve left the option open. Power supplies As with the ADC board, the op amps run off the ±9V supplies fed in from the power supply board via CON3. However, rather than passing through ferrite beads, on this board each op amp has a 10/100µF RC low-pass filter for each supply rail, as well as 100nF bypass capacitors for each op amp supply pin. Another difference from the ADC board is while that board derived a local 5V supply from +9V using an onboard regulator, on this board, DAC IC6 and (if fitted) volume control IC10 run from a 5V supply that’s fed from the power supply board, via pin 22 of CON3. The two chips have separate ferrite beads on this supply line for isolation, plus small and large bypass capacitors. DAC IC6 also requires three 3.3V supply rails – one for I/O (VLC, pin 14), one for its digital circuitry (VD, pin 7) and one for its internal PLL (VLS, pin 27). These are all powered from the same 3.3V supply rail via pin 20 of CON3, but again they have separate ferrite beads for EMI suppression and isolation, plus individual 100nF bypass capacitors. There are also 100nF and 10µF capacitors on the incoming 3.3V supply rail. Volume control As mentioned earlier, volume control chip IC10 is not required, but if it is fitted, it is powered from the ±9V rails (at the VA+ and VA- pins) and also from the 5V rail via ferrite bead FB11. The ZCEN input (pin 1) is pulled up to +5V with a 10kresistor, while Mute (pin 8) is similarly pulled up by a 10kresistor. Pin 1 is the Zero Crossing Enable control and when pulled The completed project (June and July issues) will include a 128 x 64 graphical LCD which lets you set up the unit and see how it is configured. It is controlled using a rotary encoder and two pushbuttons to drive the menu-based interface. 36 Silicon Chip Australia’s electronics magazine siliconchip.com.au high, it will wait for the audio signal to cross through 0V before making any volume changes. This avoids clicks which would otherwise be caused by a sudden signal level step change when the volume is adjusted. Unsurprisingly, pulling pin 8 low mutes the output, and this function is not used, hence the pull-up resistor. Mute can instead be controlled using the SPI serial control interface. Power supply and signal routing board Let’s turn now to the power supply and signal routing circuit, shown in Fig.6. The cable from CON1 on the ADC board connects to CON16, while two separate but identical DAC boards are connected to CON14 and CON15. 10-way headers CON17 and CON18 connect to the microcontroller board. The signals to and from the ADC and DAC boards are routed to the microcontroller pins via these headers. At the same time, five power rails are distributed to all those boards as required. Except for the master clock, all the signals from CON18 are connected through to CON19, which the front panel control board plugs into. This routes the control board signals back to the microcontroller. Some things to note about the signals passing between the micro and ADC/DAC boards: CON14 (DAC1) and CON16 (ADC) share the same digital audio bus, while CON15 has a separate bus. One DAC and one ADC module can share the same bus since there is one pair of data in/out lines and they only use one each (into the DAC, out from the ADC). The same master clock signal is distributed to all three connectors, and the reset line is also shared between all three, so the three chips will be reset simultaneously if this line is pulled low. None of the SPI control buses are wired up to anything, as this is not required as long as you leave the volume control chips off the DAC boards. The ADC and DAC boards are fed with +9V, -9V, +5V (VA, not used by the ADC board) and +3.3V (to power the digital interfaces of the ADC and DACs). A separate 5V rail passes through ferrite bead FB15 and is then fed to the microcontroller board, to power the micro. Using a separate siliconchip.com.au rail avoids the possibility of the micro board ‘polluting’ the 5V rail used by the DAC boards. All the digital audio signals connect to the micro via CON17 (along with its 5V supply), except for the master clock, which is on pin 8 of CON18. The other pins on CON18 are wired to general purpose I/Os on the microcontroller. The power supply section is pretty straightforward: a centre-tapped 18-24V AC (eg, 12 + 12V AC) transformer is wired to CON13 and then connects to diode bridge rectifier D17-D20 via fuses F1 and F2. The DC outputs of this bridge are filtered by a pair of 470µF capacitors and then regulated by adjustable regulators REG6 and REG7 to produce the +9V and -9V rails respectively. LM317/337 adjustable regulators are used because of their excellent ripple rejection capability, especially with 10µF capacitors from their ADJ terminals to ground. The 220and 1.5kresistors set their nominal output voltages to (1.5k/220+1) x 1.2V = 9.38V. The extra diodes protect the regulators by preventing current from flowing backwards through them at switch-off. These regulators are fitted with small flag heatsinks to keep their temperatures reasonable. The positive output of the bridge rectifier is also fed through ferrite beads FB13 and FB14 through to two extra 47µF capacitors which power regulators REG4 and REG5 respectively, to produce the +5V and +3.3V rails. Different feedback resistor values are used to change the LM317 output voltages. The extra ripple-rejection capacitors are not used here since these supplies do not need to be as ‘quiet’. Another LM317, REG8, is fed from the main 470µF positive filter capacitor and is also set up for a 5V output. This provides the 5V “VA” rail for both DAC boards. Coming up . . . This is a monster project, so we can’t fit all the details into a single article. Over the next two issues, we plan to have details on the microcontroller and front panel circuits, along with the parts list plus construction and operation of the of the SC Australia’s electronics magazine May 2019  37