Silicon ChipCadSoft EAGLE PCB Layout Software - October 2011 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: DAB+ radio broadcasting has a long way to go
  4. Project: Let’s Get Quizzical: A Quiz Game With A Difference by John Clarke
  5. Project: Digital LED Lighting Controller For Christmas Lights by Nicholas Vinen
  6. Project: Build A Loudspeaker Protector by Silicon Chip
  7. Project: Measuring Audio Gear Without Spending Big Dollars by Jim Rowe
  8. Project: The USB MIDI-Mate: A MIDI Interface For PCs by Jim Rowe
  9. Review: CadSoft EAGLE PCB Layout Software by Nicholas Vinen
  10. Project: High-Performance Stereo Headphone Amplifier, Pt.2 by Nicholas Vinen
  11. Book Store
  12. Vintage Radio: A look at the Radiola Model 573-MA Receiver by Maurie Findlay
  13. Market Centre
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the October 2011 issue of Silicon Chip.

You can view 28 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Let’s Get Quizzical: A Quiz Game With A Difference":
  • Quizzical Quiz Game PCB [08110111] (AUD $25.00)
  • PIC16F88-I/P programmed for the Quizzical [0811011A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (ASM and HEX) files for the Quizzical! project [0811011A] (Software, Free)
  • Quizzical Quiz Game PCB pattern (PDF download) [08110112] (Free)
  • Quizzical! Quiz Game front panel artwork (PDF download) (Free)
Items relevant to "Digital LED Lighting Controller For Christmas Lights":
  • Digital Lighting Controller LED Slave PCB [16110111] (AUD $20.00)
  • Digital Lighting Controller LED Slave PCB pattern (PDF download) [16110111] (Free)
Items relevant to "Build A Loudspeaker Protector":
  • Speaker Protection and Muting Module PCB [01207071] (AUD $17.50)
  • Speaker Protector and Muting Module PCB pattern (PDF download) [01207071] (Free)
Items relevant to "The USB MIDI-Mate: A MIDI Interface For PCs":
  • USB MIDI-Mate PCB [23110111] (AUD $15.00)
  • PIC18F14K50-I/P programmed for USB MIDI-Mate [2311011C.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (HEX and C source code) files for the USB MIDI-Mate project [2311011C] (Software, Free)
  • USB MIDI-Mate PCB pattern (PDF download) [23110111] (Free)
  • USB MIDI-Mate panel artwork and drilling templates (PDF download) (Free)
Items relevant to "High-Performance Stereo Headphone Amplifier, Pt.2":
  • Hifi Stereo Headphone Amplifier PCB [01309111] (AUD $17.50)
  • Red & White PCB-mounting RCA sockets (Component, AUD $4.00)
  • Hifi Stereo Headphone Amplifier PCB pattern (PDF download) [01309111] (Free)
  • Hifi Stereo Headphone Amplifier front & rear panel artwork (PDF download) (Free)
Articles in this series:
  • High-Performance Stereo Headphone Amplifier, Pt.1 (September 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.1 (September 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.2 (October 2011)
  • High-Performance Stereo Headphone Amplifier, Pt.2 (October 2011)

Purchase a printed copy of this issue for $10.00.

Need to upgrade from Protel Autotrax or Easytrax? CadSoft EAGLE could be the answer By NICHOLAS VINEN If you are new to PCB design or you are an old fogey stuck in a time warp with DOS and Protel Autotrax or Easytrax, now is your chance. Now you can get CadSoft EAGLE which works under the Windows, Linux or Mac operating systems. You can even get a limited version (EAGLE Light) which is available for non-profit use at no charge. You can then give DOS the flick. I F YOU ARE a rank beginner but reasonably familiar with Windows (or Linux or Mac) software which makes extensive use of the graphical interface, then CadSoft EAGLE is reasonably easy to learn. And if you are a long-time fan of Easytrax or Autotrax, you will find much that is similar in Eagle, with drop-down menus, component libraries, schematic editor and so on. Some of the contributed projects published in SILICON CHIP have been designed with Eagle, especially using How To Obtain CadSoft Eagle CadSoft EAGLE is available from Element14 (au.element14.com) or from the CadSoft website (www.cadsoftusa.com). There are four versions with some options: (1) EAGLE light: one schematic and up to two layers per board; maximum dimensions 100 x 80mm. Free for non-profit use or evaluation purposes. Or $54.45 with fax and telephone support. (2) EAGLE Hobbyist: 99 schematics and up to six layers per board; maximum dimensions 160 x 100mm. For non-commercial use only. US$125. (3) EAGLE Standard: 99 schematics and up to six layers per board; maximum dimensions 160 x 100mm. Price varies by number of users and options. $553.34 for one user with schematic and PCB layout, $830.00 with auto-router. (4) EAGLE Professional: 999 schematics and up to 16 layers per board; maximum dimensions 1.6 x 1.6m. Price varies by number of users and options. $1106.67 for one user with schematic and PCB layout, $1660.00 with auto-router. Discounts are available for educational users. Note: prices do not include GST. 80  Silicon Chip the free version which can cope with a maximum PCB size of 100 x 80mm. If you want more CAD power, upgrades are reasonably priced and within the hobbyist’s reach. But EAGLE is also a serious design package which can be used on a commercial scale. It can accommodate multiple large, complex boards with many surface-mount and through-hole parts, based on circuits spread over many sheets. Features EAGLE’s primary parts are the schematic (circuit) editor, PCB layout editor, component library edit­or, autorouter and CAM (computer aided manufacturing) facility. It also has a “script” feature which adds a number of very useful options, such as making mass changes to boards and schematics. The first step in any PCB design is to draw the circuit and you do that using the schematic editor (see Fig.1). siliconchip.com.au The main controls are arranged in a toolbar down the left side of the screen, although you can move it about if you wish. The toolbar includes buttons to add a component, move it, rotate it, duplicate it, delete it, change its name (designator) and value, swap sub-components (eg, op amp sections) and pins, route nets and so on. There are 36 standard tools. There is also a “command line” at the top of the window where commands can be typed. This gives you access to more advanced options (eg, rotating components by angles smaller than 90°). But all the most common commands are available via the toolbar, menus or keyboard shortcuts (which can easily be customised). Component libraries One of the biggest obstacles to starting out with any CAD package is gathering together a comprehensive set of component libraries. You will need resistors, capacitors, diodes, transistors, ICs, inductors, transformers, relays, pushbuttons, switches . . . the list goes on. It’s frustrating if you must spend a lot of time adding components to the library before you can draw a circuit. Fortunately, EAGLE comes with a large number of component libraries (314 at last count!). Some of these are manufacturer-specific (eg, one contains around 200 Analog Devices ICs) while others are generic, eg, common diodes and transistors. Then there is the “rcl” library which includes most common types of resistors, capacitors and inductors (through-hole and surface mount). This makes for a great start. Inevitably, you will need to add library elements for special purpose ICs and so on. But there are many EAGLE libraries available free on the internet too. For example, libraries with Microchip and Atmel microcontrollers can be found quite easily and installing them is just a matter of downloading the file(s) into the right directory. Adding custom parts is pretty straightforward. The library editor interface is similar to that of the PCB editor (described later). You can copy an existing part into your own library (with a couple of clicks) and then modify it. Since there are so many existing parts, quite often that’s all you need to do. You can also make a part siliconchip.com.au Fig.1: the schematic (circuit) layout editor, showing a portion of the SILICON CHIP DAC circuit (September-November 2009). The toolbar is at the left and the V+ power supply net is highlighted using the “show” tool (eye icon). Fig.2: the PCB layout editor showing the board for the circuit of Fig.1. You can see that the tracks forming the V+ net are also automatically highlighted. As with the circuit editor, there is a toolbar on the lefthand side but it has more and different buttons. from scratch based on a dimensional drawing in a data sheet. EAGLE components consist of three basic pieces. The first is the footprint (ie, how it appears on the PCB) and this can often be copied verbatim from the “reference packages” library, which contains around 1000 common component footprints. The second piece is the symbol, shown in the circuit diagram. The simplest method for custom ICs is to just draw a box and then arrange pins around it. Finally, there is the component entry itself which ties one or more October 2011  81 supply pins are placed separately. This can look a bit strange but makes the wiring less cluttered. In some cases, the power supply pins can be dropped on top of one of the other sections (op amp, logic gate, etc) which makes for a neater result. Unfortunately, the EAGLE libraries do handle power pins inconsistently; some parts have separate power pins and for others they are fixed. But you can use the library editor to change them to suit your needs. Nets Fig.3: using the Design Rule Check feature on a PCB layout. You define the design rules (in this case, track-to-track clearance) and it flags any violations. symbols to one or more footprints. If a component has multiple symbols these are postfixed with letters (eg, IC1A, IC1B etc). If there are multiple footprints, they have different suffixes. For example, “LM358” could have DIP8 (LM358N) and SOIC8 (LM358M) footprints. Each symbol/footprint combination can have its own pin mapping, avoiding the need to create different symbols just because the footprint pin configurations differ. This doesn’t quite work if the packages have extra electrical connections (eg, multiple ground pins or a conductive tab). In general though, the system works well. Perhaps the biggest limitation of EAGLE’s component system is that component footprints can’t be modified in the PCB as you design it. The pad sizes and shapes can be overridden but it is an all-or-nothing deal so if one particular resistor needs smaller pads or a different pad spacing, you have to create a new library element. We found that it is possible to work around this by creating a few different versions of common parts. With so many libraries in the system, one invaluable feature is the component search. When adding a component you just type a few letters, such as “diode” or “tl07*” and press enter. The list of available components then shows just those which match. This is generally a much faster way 82  Silicon Chip of finding the right component than wading through the library hierarchy. Schematic editor Drawing the circuit is just a matter of importing the components you need and wiring them up. One handy feature is the automatic component numbering. For example, the first resistor you place is named R1, the second R2 and so on. You can change these to whatever you like but component names must always be unique. This makes sense but it can be a pain if you need to renumber them. One possibility is to ignore component names initially and then use one of the provided scripts to automatically renumber them based on their location on the PCB, eg, left-to-right and top-to-bottom. That’s a time saver! There are 128 scripts like this provided with the program and more can be created or downloaded. For parts with multiple sub-sections (eg, digital logic ICs or dual/quad op amps), they are placed individually but their name (designator), value (component type) etc are linked. Sections within an IC can be swapped in the circuit with a couple of clicks as can interchangeable pins (eg, inputs to a logic gate). This is very handy during the layout stage as you can easily adjust the connections to simplify the routing. For many of these ICs, the power A net is a set of component pins which are electrically connected. It can have a name (eg, “GND” or “VCC”). A “netlist” consists of one or more nets and together with a list of components, defines a circuit. Why “net”? Well if you drew lines between all pins that are to be joined, the resulting set of crossed lines would look something like a net. To define the nets for a circuit, you draw lines between pins to form either nets (thin lines) or buses (thick lines). Buses collapse multiple nets into a single visual representation, reducing clutter on the circuit diagram. Rather than drawing a line from one pin to another to put them in the same net, you can connect them to separate lines but then set those to be the same net. Nets can be labelled on the schematic and you would certainly do so if using this technique, otherwise it’s unclear which pins are in which nets. Connecting pins to a power supply symbol (eg, GND or VCC) automatically changes the net name to match the power supply. Therefore any pins connected to the same power supply symbol are automatically part of the same net. There is a clever feature which allows some component pins to be automatically connected. Say you have an IC with VCC and GND pins. By default then, these are automatically connected to the VCC and GND nets. Unfortunately this doesn’t always work; some parts may have pins labelled VDD and VSS but you may need to connect them to VCC and GND. In this case, you can simply add explicit power pins and wire them up as necessary. We prefer this approach as it’s harder to make a mistake. EAGLE includes a basic circuit error checker (“ERC”). It can’t detect all problems but it can spot obvious siliconchip.com.au ones. This includes unconnected inputs or power supply pins, shorted power supply rails, nets with only one pin in them (or none), nets with open collector and push-pull outputs joined, multiple push-pull outputs joined (sometimes valid, sometimes not) and so on. One handy feature is the ability to copy and paste sections of the circuit, for cases where similar circuitry is repeated. In fact, EAGLE can apply most of its commands to a selected portion of the circuit or PCB which can be a real time saver. PCB layout Having drawn a circuit, you can then proceed to the PCB layout. All the components automatically appear outside the board outline with a yellow “rat’s nest” of lines showing which pins/pads are to be connected, according to the circuit. Components and tracks snap to a grid which may be set in imperial or metric units and you can swap between two different grids (eg, coarse and fine). At this point, if any parts are in the wrong package, changing to an alternative package is simple. This is handy for changing the pin spacing for passive components as necessary. You can also alter the names (designators) and descriptions (type/value) during layout. One very nice feature is the ability to turn off component names and values en masse, greatly reducing the visual clutter. Once the layout is complete you can turn them back on and move them to their final locations. All changes made during layout are automatically mirrored on the circuit diagram; there is no need to synchronise them separately. This is convenient but you must be careful when making changes to the circuit once the board is laid out. For example if you delete a connection between components, the corresponding PCB track will automatically be deleted (“ripped up”). Sometimes this is what you want but if you’re just trying to rearrange the nets on the circuit, it’s best to draw the new connection before deleting the old one so you don’t have to redraw the track afterwards. It’s also very easy to highlight a net or component in either the circuit or PCB layout and have it light up in the other (see Figs.1 &2). This makes tracsiliconchip.com.au Fig.4: this shows how the component symbols and footprints are linked in the library editor. In this case, we have a 7-segment LED display symbol with two package variants. ing tracks and identifying components a breeze. Routing Routing involves connecting all the appropriate component leads together using tracks (representing copper on the final board). This is a similar process to drawing nets, ie, you draw lines on the PCB but this time they are not conceptual but actually define the physical layout. The end result of the routing process is a PCB pattern. EAGLE has an auto-router which is present in the free version (EAGLE Light) but if you want it in the full version, it costs extra. It is basic but certainly does the job. You can assign the “cost” of tracks on different layers, vias etc and it will find a way to connect all nets (if possible) within the design rules (ie, without violating manufacturing restrictions like track widths and clearances). While it’s quite capable, we still prefer to route PCBs manually. The auto-routed layout is a good starting point but it doesn’t do much “glossing” (minimising tracks lengths, rounding corners etc). It also doesn’t use thicker tracks where higher currents will flow because it doesn’t know; it’s also unaware of the need for star earthing etc. In short it’s handy but won’t do the PCB layout work for you. Manual routing can be quite quick and easy since there are various shortcuts. For example, while drawing a track, right-clicking the mouse cycles through the various track and corner styles (right angle, 90°, rounded, snaking etc). If you change layers while routing, a via is automatically added. You can also change the track size and miter (corner diameter) as needed. Newer versions of EAGLE also have a “follow-me router” mode which is a hybrid between manual and automatic routing. Tracks in EAGLE are shown in a transparent manner so you can easily see bottom layer tracks, even if they are covered by top layer tracks or polygon fills. Polygon fills As well as connecting components with tracks, you can use polygon fills. You draw an outline, consisting of a series of line segments and then an area of copper is created inside, joining together any contained pads. This can make better use of the available area on the PCB, allowing for higher currents than with a simple track. Actually, polygon fills are usually assigned a net and in this case they will only connect pads and tracks assigned to that net. Other pads and tracks within the drawn outline are automatically routed around, with a clearance as defined in the design rules October 2011  83 Fig.5: we “ripped up” all the tracks on the PCB by selecting them and doing a group operation, then ran the auto-router. It managed to route most of the tracks. We could route the rest manually or else change the auto-router parameters to make it try harder and repeat the process. (see below). This makes them a very convenient way to connect a number of nearby pads. Polygons can be hidden using the “ripup” command (normally used to delete track sections) and then reinstated using the “ratsnest” command. This is convenient since sometimes it’s easier to work on the board without the polygon fills in place. The “ratsnest” command also re-draws the lines which show which pads are yet to be connected together. It’s called a “rat’s nest” because it can look rather messy! It can be turned off if these lines get in the way (via the View menu). Design rule checking With any PCB layout, you need to be sure that the parts and tracks are arranged in such a way to minimise manufacturing faults or construction problems, ie, components on the same side do not overlap, all nets are properly connected with no short circuits and all manufacturing rules are observed. This includes minimum hole sizes and separation, minimum track and pad clearances, minimum track widths and so on. EAGLE’s default rules are quite sensible but you may need to customise them to suit your PCB manufacturer. The rules include: • Which layers can be connected by 84  Silicon Chip vias (buried, through and blind); • Wire, pad, via and SMD pad clearances (individually settable); • PCB edge clearances for tracks and holes; • Minimum track width, hole size, blind via size and ratio; • Via pad to hole ratio (“restring”); • Supply layer connection restrictions; • Solder mask and solder paste mask clearances; and • Part grid alignment, track angles and miscellaneous. These are all easy to configure. Once you have set these you can run a Design Rule Check (DRC) at any time. Any rule violations are listed in a box and if one is selected, the offending location is shown and highlighted (see Fig.3). You can then elect to fix it, ignore it or approve it. Approved errors are moved to a separate list and are not shown unless you explicitly select them. One nice aspect of EAGLE’s DRC feature is that the violations are easily visible but they do not add a lot of visual clutter, so you can continue layout and then come back to fix violations later. Manufacturing Once the layout is complete and error-free, the board can be made. The CAM (Computer Aided Manufacturing) processor creates the necessary files. It supports many different output formats and is very flexible. The most commonly used output formats are Gerber, Excellon and Postscript. In each case, you need to produce multiple files: the copper pattern (more than one for multi-layer boards), the solder mask pattern(s), silkscreen overlay(s), drilling data and so on. Each component footprint consists of pads or polygons which exist on a particular “layer” (this is also true of board elements like tracks, vias and free text). There are about 50 possible layers, including those for top/bottom copper, pads, vias, board dimensions, component outlines, names, values and so on. In the CAM processor, you select which layers go into which output files. For example, the silkscreen layer usually combines the component outlines, names and values for one side of the board, as well as the “documentation” layer (text, etc). Each file produced normally has a different extension. Usually the copper, solder mask and silkscreen layers are saved in Gerber format while the drill data (positions and sizes) can be either Gerber or Excellon. Just about any PCB manufacturer will accept these files. Alternatively, you can output to Postscript files, print them and etch the board yourself. The CAM processor configuration can be saved to a preset (“job”) and several are provided by default, which you can customise if necessary. It’s then just a matter of loading the “job” and clicking the “Process Job” button to produce the correct set of output files for manufacture. Conclusion CadSoft EAGLE is an affordable, fast, easy-to-use circuit editor and PCB layout package. It doesn’t have a huge number of features but it certainly includes everything you need for regular PCB layout tasks. We found it pleasant and intuitive to use. Its interface is very similar regardless of the operating system used (Windows, Mac OSX and Linux) and all files are fully compatible. Probably its greatest strength is in the ability to start with the free version and then upgrade later when you need more capabilities. You can “try before you buy” so why not give it a try! SC siliconchip.com.au