Digital should not remain a barrier for diyAudio beginners. Before the digital age, diyAudio was about designing a PCB and soldering through-hole components on it.
Nowadays, diyAudio encompasses digital. It requires designing a PCB hosting SMD (Surface Mounted Devices), and it requires creating a DSP (Digital Signal Processing) program. Those are the two new difficulties.
Ten years ago, most diyAudio enthusiasts would have failed building a digital audio system from scratch. The situation has changed. There are more and more hobbyists dealing with 32-bit microcontrollers. There are more and more hobbyists overcoming the SMD difficulty.
Here is a digital audio system built from scratch. Diptrace got used for drawing the schematic and converting it to a PCB.
The PIC32MX2 gets debugged and programmed using Microchip MPLAB ICD 3 ($189.99) . A simple experimental application would read the stereo audio entering the WM8731, apply some processing like filtering, equalizing, splitting, dynamic compression or expansion, then deliver the processed audio on the WM8731 stereo outputs.A more complicated application would base on Microchip USB-audio library (see also Mike Zoran in 1998), for persuading the PIC32MX2 to behave like any USB soundcard. Connect it on any PC, and get the sound on the WM8731 stereo outputs. There can be a USB endpoint dealing with the listening volume, driving the WM8731 volume control block (only available on the WM8731 HP outputs – not available on the WM8731 line outputs).
2. Ratsnest after placing the parts
3. PCB taking shape after autorouting
4. PCB 3D view generated by Diptrace
5. How possible?
This is a digital audio system built from from scratch. It looks pretty simple because a few fundamental rules got applied.
- Before drawing anything, study the block diagram of all ICs.
- Think twice about configuring the microcontroller inputs/outputs.
- Consider the microcontroller as a collection of custom functions, the functions you need.
- Label the microcontroller pins in an explicit way, dedicated to your application.
- Do not label the microcontroller pins using the very long multifunction names provides by the chip maker. Label the microcontrollers pins using the exact name of each particular function. For each particular function, use the exact name provided by the chip maker.
- Take time adding the microcontroller in your components library like it was a custom part only dedicated to your application, using the dedicated pin names as explained above, from the chip maker.
- Take time adding all the other ICs, as custom parts, with their pinout organized for representing the block diagram, the way you are going to use it.
- Make sure all custom parts created this way, keep their block diagram correlated with their physical pinout.
- As an illustration, the WM8731 block diagram in Wolfson datasheet has the audio inputs on the left side, and the audio outputs on the right side. While physically, when orienting the chip with pin 1 on top, the inputs are on the right side and the outputs are on the left side. As consequence, both on the PCB and on the schematic, we represented the audio inputs on the right side and the outputs on the left side.
- Try keeping the schematic on one single page.
- Use net symbols for the supplies (digital and analog) and for the grounds (digital and analog).
- Only invoke other net symbols, when absolutely required for clarifying the schematic. The present schematic doesn’t invoke other nets than supplies and ground.
- Draw the schematic in a natural way, in function of the block diagrams.
- Place the components on the PCB so they reflect the schematic.
- Bear in mind that SMDs offer fewer choices than through-hole components, what’s regarding audio, especially the electrolytic capacitors.
- Bear in mind that SMD electrolytic capacitors are expensive.
- Keep the SMD inventory minimal, especially regarding capacitors. SMD capacitors should be of the ceramic type (inexpensive), never be involved in the audio signals, with values likes 22 pF (quartz load), 22 nF (reset) and 220 nF (local supply decoupling).
- Do not underestimate the visual role of trough-hole components, enabling to locate the audio signals, enabling to locate the supplies.
Such little system got designed in a few hours. The important step that’s coming after, is to ensure that the board can be easily manufactured. The source files are here : WM8731+PIC32MX2 v1.0