perjantai 26. kesäkuuta 2015

Thou shalt trust the DRC!


For most (I really hope all) experienced designers this is obvious, but hopefully this saves some beginners effort and most importantly time (and some money, too)

I cover actually two different things here, but they are somewhat related so I'll go ahead with this anyway.

When designing the board it usually goes from schematic to layout - electrical drawing to board layout. In schematic you design the connections between the components, and in layout you "just" need to place chips and draw the traces on board. Should be easy. At this point I hear experienced folks giggling, it never is that easy. The last few traces are always the worst - typically you'd have to run a trace from one end of the board to the other end, but the board is already full. So you sigh, put it where it fits (in process ripping up dozens of already placed traces, just to route them tighter together to make some room) and hope it won't look too bad. And hopefully it works too, without generating or receiving too much noise (hope you were smart enough to design those delicate analog parts first...)

Like I said, typical work flow. From schematic to layout. Especially common in larger companies where schematic and layout people may not even speak to each other at any point (in my opinion that is Really Bad, but that's just how it is).

Lately I've found out that this actually is pretty bad flow in practice. How, exactly, are you supposed to know in schematic what is the optimum for the layout? With "fixed-function" (I mean: every pin of chip has one and only one function, like op-amp) chips it's easy, but with MCUs it already grows more difficult as you can assign some signals almost any pin you want to.


Above is part of my current board under construction (I use EagleCAD. By now I'm used to it, so I have no real desire to re-learn everything if I were ever to change so I'd rather keep using it, despite its shortcomings).

Chip here is a FPGA, which are nice, allowing just about any signal placed in almost any pin. And on this board there are lots of signals, making routing a real fun job (you may notice some overlap - this board uses blind vias so those actually are okay).

But returning to my earlier argument, here the "schematic first-layout last" - design would fail really badly. If you were to naively design schematic first, placing all signal there with no care of the pin (well, pad), layout design would get really, really ugly. So here I chose to place components first, then route easy parts and only then connect FPGA and final (high-ish-frequency, many many signals around the board) components.

As a side note, this makes dual-monitor setup very very useful - whatever I'm primarily working on is in primary monitor and other has datasheet (although I often still prefer paper, but that's another topic) or schematic (when designing layout) or other helpful material on it.

So here I started going around. "I want a pin to control this component, what pin is closest?". Pick a BGA pad, connect to component, then draw on layout. Then pick next component clockwise and do same again. And again. And again, many many times. And finally I have pretty nice fanout, with fairly low effort spent.

Then to another issue: ERC and DRC. I know that first instinct often is to run those after design is done, see that they produced lots of errors and then ignore it. DON'T. EVER. DO. THAT. Really, never ignore those. You will suffer if you do. Both of these tools are there for a reason - they catch design errors. Not all of them are "real" errors but many will be, so do not ever ignore any of them before careful consideration.

So when schematic is done, run ERC first. This will generate many non-errors; non-connected pins (they may be pins you don't need, unused inputs and outputs and whatnot), overlapping nets, nets crossing without junction and so on. Lots of stupid errors, yes? No. Hidden there are real errors; pin that seems to have wire connected but doesn't; connected nets that aren't and so on. Fix them (or make your tool ignore them), all of them, and only then then proceed to layout.

So on layout the DRC. Again, there will be errors. Some may be false errors, your chip might have pads very close to each other so the default clearance makes DRC fail. Then you must fix your design rules' settings (and remember that tighter clearance may raise the board cost too) and run again.

Soon you start hitting real errors; overlapping nets, places where signal are too close together, actually cross and so on, the real errors. Some of marked errors may still be false, but DRC usualy allows you to mark there ones permanently ignored so they don't show up later. Real errors you will of course need to fix. And eventually your DRC will show no errors either.

But never, ever send your boards for manufacturing before both your ERC and DRC both report no errors. If you ignore them, you will regret it. And don't worry, even with those errors cleared, there will be sufficient amount of errors on your board anyway, especially if you are just starting as designer. But that's okay, that's how we learn. Assemble your board, fix errors on next layout and carry on. Next one will be better.









perjantai 12. kesäkuuta 2015

Printable test jig


One part of creating a product is production time programming and testing the boards. In low volumes this can be often be done completely manually, but when volumes grow a bit programming and testing can become very tedious.

In high volume production this is often done automatically with some kind of automated test system but they tend to be pretty expensive so they aren't really an option unless you're manufacturing in really high volumes (by which point you very likely have manufacturing and testing being done by some large manufacturer who has suitable adaptable test setups already).

But how about low-to-medium volumes then?

When I heard of 3D printing, this was one of the first practical (read: practical to me) ideas I came up. This was several years ago, but I haven't had need to do new test systems for a while so only now I did first test (and, granted, pretty much first attempt at 3D design at all so this isn't best looking thing there).

I'm using white filament so photo doesn't have best possible resolution but it should be sufficient. For this you'll need test points on PCB - through holes work a bit better in this case since they're self-centering.

I had some long (total about 25mm, one loose one shown at picture) test pins available so it was easiest to design the first attempt around those. Shorter ones would be better (less prone to accidental bending) but you'll have to go with what you have sometimes.

The back corner points are made to hold PCB in place and when pressed down, the clip piece at front will lock PCB in place so pins (contact points are naturally spring-loaded) will mate with contacts on board.


This was done only for programming so no testing the board is involved, but that would be fairly easy addition, it just needs more contact points to places you want to test on production.


So to program PCB in your test setup you essentially place it on board, hit button, wait until it has been programmed (and tested), take it out and move to next. Quick and easy (and more specifically so easy that you can take just about anyone to do it so you can focus on more complex details yourself)

perjantai 5. kesäkuuta 2015

Prototyping: Dead Bug construction


Last time (here) I was about to mount difficult little chip on my new board. Here is how it turned out:


So far my phone has been the best camera for taking photos through the microscope, but as you can see, it isn't exactly great for the job either, but sufficient for quick photo like this.

After some consideration and design re-check I decided against trying to reflow the plastic package on place - due to very low probability of success and the fact that two pins were actually flipped so it wouldn't have worked anyway. Next best thing was dead bug construction. Chip is placed/glued in suitable location upside down (so its legs point up, like dead bugs' legs, hence the name) and wired from there. Definitely not suitable for production but it can save some effort when prototyping (and round or two of boards before you get to final design.)

So I put some hot melt glue on board (not best for the job but other glues I had weren't any better), put chip on top of it and started soldering. Fortunately only four wires was needed so it wasn't too bad but it's difficult anyway.

Remember I said those pads are 0,25 x 0,25mm each? As it turns out, even the smallest, thinnest soldering iron tip I had is larger, making it very difficult to apply solder to chip pads without touching other pads at same time as often I ended up accidentially desoldering already placed wire.

This chip has two VCC pads (one for IO, one for analog parts) and one IO line had to be pulled high so that's three VCC pins. Now they're all same, dangling at the end of wires so noise performance won't as good as it could be but for quick testing it should be sufficient.

Then four ground pads, in somewhat difficult arrangement. Now those were a real PITA to solder as one pad tended to desolder when soldering another. Two IO pads were so very easy to solder compared to VCC and GND.

The tracks on board are mere 0,15mm wide. First I used one strand of thicker wire (in middle), but that was too rigid and working with it was way too difficult. For three others I took even thinner strand which was much easier to work with, but getting solder to stick still was difficult.

The end result is that chip responds to commands but so far I haven't had time to test it further (too busy at other functionality of the board so far), which means that some pad might still be badly soldered, causing it to behave unexpectedly or just wrong.

I'm still not looking forward to assembling next test boards...


tiistai 2. kesäkuuta 2015

Joys of prototyping


I usually assemble first prototypes of new board by hand as there tends to be errors on them and it's better to catch them before all the planned components are on board. Not all design mistakes are fatal (like having pull-up at one place and pull-down at another fighting, resulting funny behavior) but some are - like power module putting out 6,6v instead of 3,3v. So I prefer to be cautious.

Mostly hand assembly isn't that bad, even 0,5mm TQFPs are fairly easy to mount, but some components are just pain in the behind.

Like BGAs, or this one:

For reference, three footprints around there are 0603-sized resistors and capacitors. The component itself is only 2x2mm in size, and pads are just 0,25mm! (it's an accelerometer, by the way, and no, it's not available in more manageable package).

This won't be fun...

Solder mask below the footprint is deliberately scratched off, I needed to probe that line earlier. It's also four-layer board, those seemingly unconnected vias are serving other layers.