DesignSpark PCB Notes

by Rob Locher

DesignSpark PCB is a clever, useful, and free-of-charge program for designing printed circuit boards, but there are lots of tips, tricks, and work-arounds that are essential for getting work done.  This file serves to document such tricks as I find them.

Component Manager

If you're just learning DesignSpark PCB, start by learning the Component Manager.  You'll need it sooner than you think.

I made a very useful rule for myself early on, to only use components from my own library in my schematics.  That way I don't have to change the existing libraries, and all my modifications are captured in one place.  Of course it's easy to copy components from one library to another.  If I want to modify a stock component, things get a little more complicated: I have to copy the schematic symbol to my library, copy the PCB footprint to my library, make my modification, and then create the component.  The effort is worthwhile.

I also decided to make a separate component for each component value.  In other words, I have a component for a 1k resistor, and another for a 2k resistor.  It isn't necessary to do it this way: I could add the components to the schematic, and then edit them to have different values or descriptions right on the schematic.  But I think my way makes more sense.  I can always add my own internal part number to the component, there is less chance of the Bill of Materials being messed up, and the next time I need a part of the same value, it's right there.  The disadvantage is that the component list may someday be quite swelled by many similar resistors and capacitors—oh well.

I wondered how to copy component footprints from other programs.  In some cases, I don't even have the original design file that was used to create the Gerbers for a circuit board.  Not to worry: I viewed the circuit board using the free Gerber viewer ViewMate 9.6, and took careful notes from the component footprints on several circuit boards that I wanted to copy.  Usually I wrote down pad dimensions and such.

In the tradition of the Bill of Rights, here is a list of rules, just in case the guidelines in the previous paragraphs weren't clear enough.  These are rules for me, and suggestions for everyone else:

  1. All components used in schematics shall come from our library.
  2. If a component from another library is perfect for the job, then it can be copied from the other library, but it must be given a different name.
  3. The same principles should apply to schematic symbols and PCB footprints: if a symbol or footprint from another library is perfect for the job, then it should be copied to our library and given another name before being used.
  4. Component names should be globally unique.  This should be a hard and fast rule enforced by DesignSpark, but it isn't; if the name isn't globally unique, then all sorts of strange and undesirable things can happen.  See below.

I discovered what I first thought was a bug, but it turns out to be just a poor design feature.  When a component is added to a schematic, or a schematic symbol is added to a component, the schematic or component file just stores the name of the component, but not which library it came from.  I discovered this fact when I created a component that had the same name as a stock component, and then tried to add the component to my schematic using Add Component (F3), which yielded the following message:

Warning: Component will actually be loaded from Library:
C:\Documents and Settings\All Users\Documents\DesignSpark PCB\Library\diode.cml
which takes precedence over specified Library:
C:\Documents and Settings\All Users\Documents\DesignSpark PCB\Library\mylib123.cml
Do you wish to continue?

I had thought the feature was a bug earlier, because when you create a schematic symbol with the same name as a stock symbol, the component just uses the stock symbol without asking the user!  I searched for the keyword 'precedence' and was taken here, which explained the issue nicely.

So watch out! Either create components with globally unique names (ugh), or better yet, create your own library folder and add it to the top of the list of folders in the 'Folders' tab of the Component Manager.  One "gotcha" to mention: once the program updated itself, and when I started it up again, then the library folder was no longer at the top of the list.  This caused lots of problems until I figured out what had gone wrong and fixed it.

I'll add a couple comments.  First, copying the component into one's own library doesn't necessarily mean that you have it, because the component will refer to the schematic symbol and PCB symbol from their original libraries.  If you want to make a component well and truly yours, you should copy the schematic symbol and PCB symbol into your own libraries, with different names of course, and then make a brand-new component in your own library using the copied schematic symbol and PCB symbol.  Only then will it be well and truly yours, so that if a new version of DesignSpark should delete or change the original component, you won't be affected.

My second comment is that it is always possible to rename a schematic symbol and a PCB symbol when they are copied into your own library, but if you should make your own version of a component such as I do, then it won't always be possible to change the name.  After all, when I made my own version of a component for a 2N7000 transistor, I didn't want to call the component anything other than "2N7000".  This makes putting your custom library folder at the top of the list (in the Folder tab of the Library Manager dialog) absolutely imperative.

I added several schematic-only components for +5 V arrows, ground symbols, and so on.  Of course as far as laying out a circuit board is concerned, the purpose of such symbols is, for instance, to make sure that whatever touches the ground symbol is part of the net called 'GND'.  The program doesn't care that that point is considered the voltage reference; it just cares that everything touching a ground symbol is connected together.  I wasn't quite sure how to do make the schematic-only component automatically connect to the 'GND' net.  It turns out to be simple: when the component is edited, there is a grid-style display of pin properties above the pictures of the schematic symbol and the footprint.  (There is also a 'Properties' dialog that edits other properties of the component.)  Just add the name of the net to the the 'Net' column for the pin.

Board Layout

Once the schematic has been laid out, then it's time to translate the schematic into a board layout.  If you've been carefully creating components with actual footprints as you went, then laying out the board shouldn't be so hard: all that's left is the "simple matter" of placing the components and routing the traces.

There is a feature that will automatically place parts on the board, leaving generous spacing, but I found out the hard way that it doesn't work very well if the board is crowded.  If the board will be crowded, it's much better to place the parts and route the traces manually.

For my first project with DesignSpark, I ran into a problem.  For the resistors, which were through-hole resistors of course, I initially used a footprint that had the resistors lying flat on the board, but I soon ran out of space on the board.  I found myself having to change the layout of every resistor so that it stood up.  I thought that this would be a real ordeal, but thanks to some nice features in DesignSpark, it wasn't bad at all considering.  First I created the new footprint of a standing resistor, copying the footprint from another circuit board designed with different software.  Then I created a new component for every resistor value I'd need, as follows: first I copied the old component to the new component with a different name.  Then I edited the properties of the new component, and told it to use the new footprint instead of the old footprint.  Bada-boom, bada-bing, I had all the new components I needed.  Then I went into the schematic, and edited the properties of each resistor.  In the pane on the right side of the window, under the "Goto" tab, there is a list of all the components, which makes finding all the resistors in order a simple process, much easier than scanning all over the schematic and keeping a paper list.  The properties dialog of a part on the schematic has a button to change component, excellent!  Next came the really amazing part: I did "Tools > Forward Design Changes..." and the footprints of all the resistors in my existing dysfunctional board layout were updated, with all the ratlines intact, in more-or-less the same places.  What a wonderful feature.

The first time I tried to forward the design changes from the schematic to the circuit board, the program gave me some kind of grief about needing to back-annotate changes to the schematic first.  I think I was presented with a very confusing list of options.  I wasn't sure what any of that was about; no doubt I had done something clumsy when I was feeling my way around the program.  I just closed my eyes and said okay, and then I forwarded the design changes from the schematic to the board layout.  Everything turned out fine, with the possible exception that every resistor on the board had not only the reference designator on the silkscreen layer, but now also the resistor value.  I had to edit every resistor on the board layout and tell it to not to do that.  I probably had done something wrong there, left some box in some damned dialog unticked; I'll have to figure out what I did wrong for my next board.

I should mention that my first DesignSpark project, which I'll call the Microphone Tester, was also my most complicated board layout to date, and only the third circuit board I'd ever laid out.  It's a more complicated circuit than what its name suggests.  My friend Dave, who is an experienced electrical engineer, once told me to never use the "auto route nets" feature.  He said that I could wind up with a trace for a weak signal right next to a trace for a strong signal, etc.  My boards to date had all been relatively simple designs that don't use RF, so I felt free to ignore his advice.  The auto-route feature is pretty spiffy: it's fun to watch the computer figure out where the traces should go, and it sure saves a lot of work—the computer chugs away for a few minutes, and blammo, all the traces are laid out like magic.  In fact I hadn't ever laid out a single trace.  The autorouter worked great for my first two designs: the circuits worked as advertised, and the autorouter did its work so well that there wasn't a single via, because it always found a way to use a component pad instead.  For the Microphone Tester I did use the auto-router, but being a fairly densely packed circuit board, the auto-routing wasn't as easy as I'd hoped.  The first several times I used it, the autorouter wasn't able to route a few traces.  I moved things around to give parts more room in the trickiest part of the board, and eventually the autorouter was able to get the job done, although there are lots of funny-looking traces, and also 105 vias, which seems like a lot to me for a little 50 cm2 board.

Update: I decided that 105 vias was too many, so I unrouted the board and then routed it manually.  It took a long time, but I think the design is much better.  It's much cleaner-looking, and there are only about 10 vias.

Anyway, now I can say that one shouldn't always depend on the autorouter.  One should know how to route traces manually.  One can always route the critical ones manually, and then let the autorouter handle the rest.  Update: the autorouter does a lousy job of routing just one complicated trace, because there's nothing to optimize.  It seems as though one might as well let the autorouter route most of the traces, or none at all.

Generating Gerber Files

I was surprised what a pain it is to export the Gerber files.  This is a direct result of the fact that the industry-standard format, a Zip file full of Gerber files and Excellon files, is a terrible standard.  I discovered that Excellon makes automated equipment for drilling holes in circuit boards, and the Excellon file that tells the board fabricator where to drill is just instructions for the machine.  I suspect that a Gerber file is just a bitmap file.  (At least it's better than a DXF file generated by Autocad, which doesn't even contain dimensions.)  This is a terrible standard for an entire important industry.

Aside—this is what happens when computer programmers let the customer define the requirements of a project.  Obviously, the whole Gerber-and-Excellon-files-wrapped-into-a-Zip-file "standard" was created by electrical and mechanical engineers.  Surely programmers had misgivings, but their bosses decided to let the customers dictate the requirements.  Here's a for-instance: there is no rigorous definition of the outline of a board.  In practice, a line is drawn in one or more of the Gerber files, and when the fabricator sees that the line corresponds to the dimensions of the board given by the customer, then the fabricator knows that the line is where the router should cut the board from the larger panel.  How ridiculous!  Obviously there should be a file format defined by an industry coalition, which contains unambiguous definitions for everything that a circuit board might contain, and then this unambiguous format could easily be translated into instructions for the machines.  But no such format exists yet.

Okay, enough ranting, sorry.  Anyway I had a surprising number of problems generating the "Gerber files" (actually a bunch of Gerber files and an Excellon file wrapped up in a Zip file).  By default the program generated Gerbers for layers that were not in the design at all...  I wonder what that's all about...  The output files were all just dumped into the main project folder, yuck.  I unchecked the boxes for the useless layers, and found the option to put the exported files into a subfolder.  Then when I went to, I discovered hundreds of warnings of "potential show stoppers", which turned out to be the fact that the vias were all covered by soldermask.  To FreeDFM there is no difference between a pad and a via, hence the warning.  As a computer programmer I took compiler warnings almost as seriously as compiler errors; compiler warnings are easily avoided and are evidence of sloppiness, and sloppiness often leads to bugs that are very difficult to track down later.  So I'm culturally biased to take warnings seriously.  Besides, vias are useful as places to put test probes.  So I found and ticked the box that said to not cover the vias with soldermask, or solder resist as it's called in DesignSpark.

I also had a difficult time discovering how to handle the board outline.  From Advanced Circuits I learned the crucial fact that there is no cut & dried way to define the outline of the board; fabricators look for a line in the Gerber file for any layer of the board, preferably the top soldermask layer for Advanced Circuits, and as long as the line has the same dimensions as the board dimensions specified by the customer, then they will use that as the line for the router to follow when cutting the board from the larger panel.

But how to put the board outline in the Gerber file for a given layer?  I had to look surprisingly hard for the answer to this question.  People in the DesignSpark online forums gave smug answers to the befuddled newbies who asked this question.  It turns out that the user clicks "Output > Manufacturing Plots..." and then clicks on the desired layer, the "Top Copper (Resist)" layer according to Advanced Circuits, and then double-clicks "[Board Outline]" to change N to Y.  That associates the board outline with that layer, which is what we want.  Then all the user need to is click Run to generate the files.  For some reason DesignSpark outputs a layer that wasn't asked for, the "Through Hole (Unplated).drl" file, which also contains the board outline.  Why this file is a Gerber file with a .drl extension, I don't know, but I deleted it manually because it confuses

One more tip: it can be helpful to relocate the coordinate origin to the bottom-left corner of the board.  In that way, if you forget to put the board outline in one of the Gerber files, the fabricator can more easily guess where the outline should be.

SMT Notes

I recently had a board assembly with SMT parts built, and the assembly house asked me for a centroid file.  (I didn't have the data, so they had to construct the file manually.  I bet they wish they had noticed that before sending me the quote.)  I was quite curious about what a centroid file is, so I did some research.  It turns out that there is no well-defined standard, which of course isn't much of a surprise.  The centroid file is just a .csv or .xls file containing "X, Y, Theta (Rotation), Side of Board (top or bottom), and Reference Designator", to quote  Searching the DesignSpark online help wasn't useful.  However I soon discovered that clicking "Output Reports...", and then clicking "Component Positions CSV" and then the Run button, generates the exact file that is required.


The learning curve for DesignSpark is obviously fairly steep, or I wouldn't have written up these notes.  But the software is quite powerful and contains many advanced features, and isn't limited to boards of a certain size like the free version of Eagle.  I like it and I plan to use it from now on.  I only wish the industry standard files that define a PCB and the parts on it weren't quite so stupid.