Screaming Circuits: Circuit Design


Do you Need that Part? Or, is it Just Habit?

At the moment, I'm working on an Arduino compatible clock. Like most of my Arduino compatible boards, this one uses an Atmega32U4, with USB built in. With the Atmega32U4, I sacrifice a little in program memory and SRAM, but gain a bit in reduced parts count.

A USB capable Arduino-compatible is, of course, programmed via USB, and can be powered by the USB port. Most Arduino boards also have a 5 volt regulator to be used when being powered by a wall-bug power supply. Naturally, I put the USB connector on the clock board, as well as the 5 volt regulator. With the two different supplies, I also put in circuitry to auto switch sources and protect the USB host when both supplies are connected at the same time.

NeoPowerSupplyMy first PCB revision required a few hand-mods, but not many. Still, I decided to re-spin the board and remove the two mod wires. While doing so, it suddenly occurred to me - a blinding flash of the obvious - that most cell phones and other small devices are charged with a USB-connector 5 volt wall-bug power supply. Why then, would I also need a separate power supply and on-board 5 volt regulator?

By pulling the regulator off of the board, I could eliminate a few capacitors and the supply auto-select / protection circuitry. Not only did I save in component cost, but I was able to reduce the PC board size, and thus cost, by about a third.

  1. I had the 5 volt regulator in the design because Arduinos can be powered by either USB or a non-regulated power supply.
  2. The reverse power protection is necessary to prevent damage to the USB host if the other power is also connected.
  3. The auto-power switching circuit is necessary so that a user doesn't need to flip a switch or change a jumper when changing power sources.
  4. I had two extra LEDs to indicate which supply was powering the clock.

I questioned my original assumptions, found a "because it's always done that way" and eliminated it. Assumptions are meant to be challenged.

Duane Benson
Question authority!
And then get squashed
(or, squash extra space out of your PCB)

VTP - Very Tiny Parts

FreescaleKL03A while back, I wrote about a new ARM Cortex M0+ chip from Freescale. It's not the first M0+, but I do believe that it's the smallest. I've been checking stock off and on and finally found the smallest package to be in stock and available to ship.

I actually bought a couple of different types. First, there's the WLCSP 20. It's got 32K FLASH, 2K SRAM and an 8K bootloader. The real kicker is that the package is only 1.6mm X 2.0 mm. I also got a few in the QFM 16 package, which is a bit more workable at 3mm X 3mm.

Finally, I bought a Freedom development board with th 4mm X 4mm QFN 24 package. The dev board is hardware compatible with Arduino shields, so that will make for some interesting possibilities.

Anyway, here at Screaming Circuits, I'm most interested in that 1.6mm X 2.0mm package to see how easy (or difficult) it is to use - see if there are any particular layout challenges. The other stuff is just for after hours play time.

Duane Benson
I'm not a number. I'm a free development board!
(Free, as in named "Free...", not free as in "don't cost nothin")

Cost Reduction in Design - More Advice for Makers

If you're looking for the absolute, cheapest possible assembly service, you'll need to look outside of North America. If you really need a decent price with good quality and good service, you can keep your gaze West of the Atlantic and East of the Pacific.

Like everything else in the modern world, design decisions can have a pretty big impact on your cost. So, lets take a look at some design decisions that can make your manufacturing more affordable.

  • Accept longer lead times

Lead times are one of the biggest factors in electronics manufacturing. Screaming Circuits can turn a kitted assembly job overnight, but it costs a lot of money to do that. Screaming Circuits also has a 20 day turn-around that is much, much more affordable. Accepting longer lead times on PCB fab will drop your cost as well.

  • Avoid leadless packages like QFNs and BGAs

We build tons of QFN and BGA boards - even down to 0.3 mm pitch micro BGAs. That's great if you need those packages. However, since all of the leads are underneath, we have to x-ray every part. That adds a bit of cost to the process. If you can, stick with TSSOPs and other parts with visible leads.

  • Use reels, or 12" or longer continuous strips

Tab routed multi panel 1024We will gladly assemble parts on strips of almost any size. But, to save costs, use full or partial reels or continuous strips of at least 12" long. It costs us less time to work with reels and continuous strips, and we pass those saving on.

  • Stick with surface mount

These days, thru-hole components tend to be hand soldered. That costs more than machine assembly, so use surface mount wherever possible. Surface mount components tend to be less expensive than thru-hole too. If you do need a few thru-hole parts, this is an opportunity to put in a little sweat equity by soldering the thru-hole yourself and save a bit of money.

  • Panelize small boards

We can work with really tiny boards individually, but sticking with a larger size makes the job easier, and, again, we'll pass those saving on. If your PC board is smaller than 16 square inches, panelize it. We put in less labor and you get a price break.

By sticking with Screaming Circuits, you get the same care and quality that we give to boards going up into space, down into the ocean, and everywhere in between. By sticking with Screaming Circuits, you get a known turn-time; not an "about ..."

By following these guidelines, you get a decent price and really good quality and service.

Duane Benson
That would be telling

Unsolicited

I have a question for you. When is the last time that you responded to an unsolicited email? It's been a very long time for me. However, I just did open up and read an unsolicited email that actually seems somewhat relevant to me. The specific subject was an offer to be a guest blogger here on blog.screamingcircuits.com. I don't know that I'll take them up on the offer. It kind of depends on what they might want to write about.

But I did jump over to their website: www.circuitspecialists.com. I've never done business with them, but they do have some interesting products and they started in a garage in 1971. Anyone who started in a garage 40+ years ago and is still around must be doing something right. Their site looks like it's more or less focused on test & measurement, prototyping, robotics and other things electronic. (I think I've heard the term "prototyping" someplace...).

What first caught my eye as relevant was their section on digital panel meters. Why would that catch my eye, you might ask? (Or you might not) The first panel meter I looked at is an "independent power supply version." Ah, the plot thickens. Just last weekend, I exploded a power supply in a robot I'm building. It didn't actually explode, but it certainly did release smoke and stopped releasing electrons at about the same time. Smoke for electrons is not  a fair trade as far as I'm concerned.

I was putting a digital Ammeter on the main power line and couldn't remember if it the meter was designed for high side or low side. Poof! I empirically determined that it was designed for low side. I should have known better because it drew power from the robot power supply without any isolation.

If my meter had an isolated or independent power supply, then I could probably have put it on the high side. Oh well. It wasn't the first time I've traded smoke for electrons, nor will it likely be the last.

Duane Benson
rhythm characterized by regular recurrence of a systematic arrangement of basic patterns in larger figures

BOM process

All of this talk about BOMs these days, (all of my talk, that is), kind of begs the question of how BOMs are put together. An Excel spreadsheet seems to be the most common "BOM management" tool in use today. Large organizations often have more formal systems, but for everyone else, it seems to be largely a manual spreadsheet process.

When I'm putting together a new design, I first look at the big parts, like MCUs and other "big" chips. Sometimes big is 3mm X 3mm, so "big" is a relative term. Then I'll put in active discreet components and connectors. Next will be specific passives (like for a crystal that requires a certain value of capacitor) and finally, the more generic components like pull-up resistors and bypass caps. This may not be the best, or even a typical process, but it seems to work for me and it more or less follows my circuit design process. There are some traps that I leave myself open to.

I pick the big components based on what the board is going to do and how much real estate I have. The next set of components are largely used to make the big components work. The specific passives attach to parts with specific requirements and the generics just get thrown in as needed. Often I don't even define the generics until after the design is complete. Take a look at this schematic clip:

Non-specific components
U3, the MCP73833 battery charger and U4, the ADM3101E RS232 line driver will both get specific part numbers right off the bat. I may change packages as I get into the layout, but I still will usually fill the BOM for those items when I put them in the schematic.

IC part of BOM

I've put U3, the charger chip in my BOM twice, each with a different package, because my preferred package isn't available at the moment but might be soon. It's not best-practice, but you can do that as long as the reference designator differs in some way and the part is labeled "DNS" (Do Not Stuff). I simply gave my alternate the part number "U3alt".

R6 and R8 get specific values because the battery charger chip calls out for specific values. Q1 will be a small P-channel MSOFET, but the specific part number can come later. All of the rest of the resistors and caps will also be defined later.

The biggest trap I have to watch for when filling out the BOM in this order is forgetting any design decisions or leaving fields blank when I go back and fill in the rest of the part number information.

Passive part of BOM
This is typical of a BOM of mine just after I've finished the layout. If I were building this by hand out of my own parts bins, this would be fine. But when sending it out for assembly, it's not. I personally know that C3 and C4 could be any of a dozen different part numbers. The only things that matter in that case are that it's .01uf, it's an 0402 and the voltage rating is 10 volts or higher. I know that R2, R3, R4 and R5 are just LED current limiting resistors and can be anything between 220 and 680 ohms for this particular circuit.

I know those things, but the assembly house doesn't know that those parts have pretty loose specs. It will just cause delays if I don't find an exact part number before sending it out. It may seem obvious, but just because it's obvious to me doesn't mean that it's obvious to anyone else. That ambiguity has to be gone before anyone else sees it.

Duane Benson
Knock three times
on the ceiling if you want p-channel.
Twice on the pipe If the answer is n-channel.

To Mod or Not to Mod? That is The Question

Many years ago, I was a product manager at a business-consumer electronics company developing some pretty leading edge display equipment. Prototyping back then was a long and painful process. A PC board might take a month or two to arrive from fabrication. Parts had to be sourced by digging through massive catalogs and then hoping that what you needed would be on the companies approved vendor list. The whole process was a bear.

Well, the soldering up part wasn't always so bad - unless you were the poor soul tasked with wire-wrapping or hand soldering the prototype.

Based on how difficult and expensive a board spin was back then, common practice was to just mod up the boards, even in production. Any given PCB might have a dozen or more cuts and mod wires. Those changes might not make it into the PCB for months. These days, though, you can get board fabbed Mod wireovernight, your parts delivered over night, and when you have all of those parts and PCBs, you can get them assembled overnight. I suspect that increase in speed is the major reason mod wires seem to be nearing extinction these days. (note that Screaming Circuits didn't build the board in this picture. It's from my personal collection)

It may not seem cheap to pay to have someone re-spin a board so speedily; especially when set next to hand soldering. But when compared to the cost of idle engineers waiting for the next rev, the cost of adding mods, the reduced reliability from having mods and the additional manufacturing time caused by modding a board; today's quick-turn parts, fab and assembly options can end up saving gobs of time and money in the long run.

Duane Benson
There are more wires in heaven and earth, Horatio, Than are soldered on your pc board.

Check Again.

How do you know? How do you know what? It could be how do you know if that new restaurant has good food, or how do you know that the car you're about to buy isn't a lemon. It could be a question of how do you know that the cigarettes you're smoking will mess your lungs up. Wait. You do know that answer to that one.

But I'm talking more about substitutions. When choosing a part, there are a wide variety of parameters to check. Some mater for your design and some don't. If you run into a part that exactly matches all of your parameters, you'll probably be okay. If that specific part is in short supply, how do you go about finding a suitable substitution?

A good example is the CDBW0520-G, Schottky diode. I had used that part in the past because it was physically small enough (SOD123) and had the stats I need. I pulled that same part number out of an old BOM to use in a new design. When I went online to check the price, I found that they were almost out of stock. I remembered when I originally searched for that part, I had a lot of trouble finding anything in that particular package. I could go to a physically bigger part, but I really didn't want to. Space isn't super tight, but tight enough.

I needed as low a forward voltage as possible, and this part drops just over a third of a volt and can pass half an amp through. My first instinct was to look at higher current versions, but they all had bigger packages. Next, I looked within the same manufacturer for a higher voltage part. I found one with a 40V max in the same SOD123. That was fine. The original was 20V.

The only bummer was that the CDBW0540-G drops half a volt. Not a great difference, but when your supply is 3V, you need to keep as much as possible. For some reason, a few days later, I searched for the part again and must have taken a different route down the parametric search because I found one from a different manufacturer with 340mV drop and a package just a hair smaller. And, it has a higher current rating to boot. That makes me happy and content.

Duane Benson
...because I live in a split level head.

Family Reference

I've written a bit about reference designators here and there. There are a few more factors that we run into now and then. Take the family panel. In case you aren't familiar with the term, it means that you have several different designs laid out into in one panel, as opposed to multiple copies of the same design in one panel.

Using a family panel can be a convenient way to deal with a multi-board design and can sometimes save a bit of money. Just a caution, though. Make sure to check with your fab house first. Some don't like family panels and some won't separate them for you. If you do have them separated prior to assembly, either at the fab house or by you, then you don't have any reference designator worries.

S 065 My-9 600 If you leave them in the panel and wish to have them machine assembled, it can get a bit more complex though. "Why?", you say. I'll tell you why. Generally, most people start at "1" for each new design. i.e. "D1, D2, D3... R1, R2, R3..." If the boards go into the machine independently, that's no problem. However, if you send the panel into a smt assembly robot, it may very well see that as your board having multiple D1's, R1's, etc. That would be rejected as an error in most cases.

If you are using the family panel approach, don't restart your numbering when you move to another one of the designs that will be in the panel. Either continue on from the last number in the prior design, add in a hundred's, with each design getting a different hundred's number or add a unique suffix on each board.

  1. Wrong way: PCB1: "R1, R2, R3, R4, C1, C2". PCB2: "R1, R2, R3, R4, C1, C2".
  2. Right way: PCB1: "R1, R2, R3, R4, C1, C2". PCB2: "R5, R6, R7, R8, C3, C4".
  3. Right way: PCB1: "R101, R102, R103, R104, C101, C102". PCB2: "R201, R202, R203, R204, C201, C202".
  4. Right way: PCB1: "R1A, R2A, R3A, R4A, C1A, C2A". PCB2: "R1B, R2B, R3B, R4B, C1B, C2B".

There are a lot of ways to do this. Just make sure that no reference designators are repeated from one board design to the next. I prefer method #3 myself.

Duane Benson
Is it immediate or extended? Does it matter?

Favorites

What's your favorite MCU package and why?

  • The DIP is big and easy to use. You can stick it in a breadboard (wireless or soldered), a socket or easily hand solder it. But, it tends to be more expensive and takes up more real estate.
  • SOIC is a good step down in size. It can be machine soldered. It's big enough that most people can hand solder in a pinch. But, as an SMT, I'm not sure it has much purpose anymore. If there's an SSOP available for the same part, why would you take the bigger SOIC package?
  • SSOP are nice and small so that, unless you are really tight on space, they'll do just fine. They aren't really any more difficult to layout than and SOIC. If you do need to hand-solder, this package is probably too small. Being smaller with everything else being equal, it might have more issues with heat dissipation than the bigger part or a smaller one with a heat slug under it.
  • QFP - these are just lie either an SOIC or SSOP, but with leads on four sides.
  • BGAs are really compact and and do a good job of keeping signals close to the PCB and to bypass caps. They can be a challenge to layout though. Many will require upping your layer count. The really fine pitch BGAs may require expensive PCB features such as blind or buried vias. CSP and WSP BGAs can be more difficult to handle because of their small size. Breathing on them wrong can toss them around like dust.
  • QFN and DFNs are somewhat newcomers to the scene. The package can lead to some very tiny components. It's great for signal cleanliness and the heat slug underneath can dissipate (with proper layout) a lot of heat. But, QFNs and DFNs seem to garner the most layout problems. Careful use of thermal vias is critical for maximum performance, but you either have to use expensive techniques, such as filled and plated vias, or you have to rationalize and get around some nearly mutually-exclusive requirements.

Yeah. They all have their pluses and minuses. Fortunately, with proper board design, our SMT machines can place all of the these types all day long without breaking a sweat. All the SMT designs, that is. We do hand place the DIPs. What's your preference?

Duane Benson
All we are is BGAs in the wind

CAD This or CAD That

I use Eagle CAD a lot. I can get away with the "Light" version, because the designs I create are small and non-commercial. I do use them sometimes to illustrate points here on my blog, but I think that still meets the qualifications of their free version. It's a good program and the multiple license levels from the free version up to the full professional version add a lot of flexibility to have the software grow with you.

Our partner, Sunstone, builds most of our PCBs here, which is a nice segue into an alternative CAD package. There are a lot of reasons to pick one CAD package over another. I won't go into that here because those reasons tend to be specific to the application. Most CAD packages are sold as a lump-sum purchase up front. A lot of them also have yearly license renewal fees. That works sometimes, but there are other times where up front costs are more important. The model that Sunstone uses for PCB123 is to provide the software at no charge and just add a little tiny bit of the software cost onto the PCB board purchase.

PCB123 isn't the only package that follows this business model and is tied into a specific PCB vendor. But, as far as I can tell, PCB123 is the only package of its sort that has enough capability to be a viable replacement for more traditional pay-first CAD packages.

I recently downloaded V4.1.11 and have started to run it through my own personal "can I use this for my stuff" test. I know it's a good package because we, here at Screaming Circuits get boards of all sorts designed with PCB123 to assemble from all manner of company. But, something can be a good package and still not fit an individuals specific requirements. Hence my personal tests.

I do find it odd, but not really an issue, that it starts you off in the layout editor instead of the schematic editor for a new design. Oh well. One click and I'm in the schematic where I can search for my parts. I use PIC chips and it's pretty rare that I find the exact chip. I always seem to have to find something close and then modify it, which just adds more opportunities for error. I know there's a jillion 28-SOIC,M28B_sml varieties, but once in a while it would be nice to just find the actual part.

Fortunately, today I'm looking for PIC18F2320 in an SOIC package. Fortunately, because it's actually there! I hit the "Insert" menu and choose "Add Part". Then I put "PIC18F23" in the search box, and there it is, but not on the computer. It was in their online labraries. (In the cloud?) It took all of about 15 seconds to automatically download the library footprint though, so first test = passed.

And the really cool thing is that once I have that part in there (for the parts found pre-made in the library), I just select the "Bill of Materials" tab down on the bottom and I can see if DigiKey has the part in stock and how much it costs.

Duane Benson
If it's in Oregon, the "cloud" is probably a rain cloud