Getting access to a better world.
I have a project coming up that needs a lot of I/O and USB support. I could do this with my usual staple of a small DIP-packaged AVR microcontroller, along with a bevy of support chips. I would need a bunch of shift registers for the I/O, and an FTDI chip for the USB duties. Then I’d need some glue logic and a bunch of passives to tie it all together. A lot of components. Wouldn’t it be great if there was one chip that would do all of this for me? Well, in fact, there are all kinds of chips that can do all of this for me. The catch? The good stuff doesn’t come in hobbyist-friendly DIP packages. Surface-mount components open up entire worlds of very cool silicon that will never see the light of day in a through-hole package. Because of this, I’ve been meaning to get my hands dirty with Surface Mount Devices for quite a while. This upcoming project is the perfect excuse!
The first device (on a long list) that I want to try is the ATMega32U4 microcontroller. This bad boy has 30-or-so I/O pins, and on-board USB, all in a space smaller than a US dime. Remarkable! If you’re going to dip your toes into SMDs, you might want to start with a big friendly SOIC-8 package, or maybe a TSOP. Never being one to do anything half-way, I’m diving right in with a TQFP-44. This is a 10mm square package with 44 pins on 0.8mm spacing.
A good way to experiment with this chip, test my project ideas, and get practice with soldering SMT is to build a breakout board. So let’s do that! Note that we’ll also need a way to program these teeny tiny microcontrollers. Normally I use one of my BreadHead devices for this. I have them for all sizes of DIPs. However, that approach can’t work for an SMD. What we could do, however, is bake a programming header into our breakout board. So let’s do that too!
I started by knocking out a quick schematic in KiCad. This schematic exists only to placate the PCB layout tool, really. It’s only the PCB we’re interested in here. Thus no effort has been made to make it look nice, and there’s no reason you’d want to use this for anything.
With that, we can get to the real job- the PCB layout. This mini-project is my first end-to-end circuit board with KiCad, and I have to say I like it quite a bit. I tried it a few years ago, and the experience served only to solidify my Eagle snobbery. However, it has come a long way since then. I found it to be very pleasant to use, and the separation of schematic symbols and footprints is very handy. The libraries aren’t as good as Eagle, but making new parts is very quick and approachable. The whole thing is more polished and powerful than I expected, and I’ll definitely be using it again. The all-text-based file formats are great too, because that means I can easily share them on GitHub. So I’m sharing them on GitHub.
I used the “bottom” layer to connect the programming header, but that will done with jumpers. This already feels weird, because I’m used to using the bottom layer for real copper, and the top for jumpers. Surface Mount is already a brave new world for this naïve little hacker.
I decided to etch this board myself, because why not? It’s simple enough, and my salt-and-vinegar etching process is pretty dialed in at this point. Here’s where I made my first rookie mistake in KiCad. I neglected to check my trace widths. It wasn’t until I had made the mask for photo exposure that I realized I had left the traces at the KiCad default of 0.25mm (about 10mils). This is very, very fine. Well, I figured- I’ve come this far. Maybe my process can handle it? I’ve done traces down to about 16mils in the past. Can I go down to 10? Only one way to find out. Let’s expose the mask, develop it, and see what happens.
As you can see, the photo developer completely obliterated my 10mil traces. Clearly this is outside the capabilities of my process. This result surprised me a bit, because this a photographic process, and the resolution should be incredibly high. Unlike the toner-transfer method, there is no mechanical process involved here. Every step is chemical or photographic, which is what makes it so precise and repeatable. So why can’t I etch a trace as thin as the laser printer is capable of printing? I got to thinking (always dangerous)- what is the theoretical limit of my process, and what factor(s) control that?
I don’t know for certain, but we can do a little thought experiment. The photo mask of the PCB serves to protect areas of the sensitized copper from the UV light. These are the areas of copper we wish to retain. Thus, if my traces are being wiped out by the developer, that means they weren’t protected from the light. The traces in question were clearly visible on my mask, so how did the light get to them? My masks are black areas laser-printed on transparency sheets. To guarantee good masking, I print two copies and stack them up. This means my mask is actually a layer of plastic with toner bonded to the surface, times two. Assuming (generously) that the lower layer has the toner against the PCB being exposed, it looks something like this:
If we accept that two layers of toner are needed to shield against the UV, then even with one layer of toner against the board, some UV is only “seeing” one layer due to the thickness of the transparency sheets. This means my minimum trace width is a function of the thickness of my transparency sheets. The ideal mask would perfectly opaque and infinitely thin. The process would then only be limited by the laser printer’s resolution. I may experiment with mask creation techniques to further test this hypothesis. In any case, for now I’ll just increase my trace widths to 0.55mm (22 mils). This is the size of a TQFP pad, and easily etched by my process.
Now it’s time to get down to business- soldering a 0.8mm pitch package without a reflow oven or other special tools. There are a lot of techniques out there for this, involving exotic paste or special iron tips. The method I used is very simple, and worked just fine with my standard Weller chisel-tip iron and off-the-shelf solder. I used a basic head magnifier, but nothing fancy like a binocular microscope. SMD is easier than you think! The process I used was to tin the pads, place the part, then heat the pins and let them sink into place. Very simple, and it worked like gangbusters.
After tinning the pads, I checked for shorts with a meter. They can be very hard to see by eye, but the meter misses nothing. Any shorts are easily cleared by wiping a clean iron along the gap between traces. The solder doesn’t “want” to bridge gaps. It wants to be on the copper and on the iron. All it needs is a little encouragement. Who are you to deny it?
Once the part is anchored, I checked for shorts again. This tells me if the pins themselves are bridging pads anywhere. You really want to know now if that’s the case. There’s no turning back after this.
The pins are melted in place by lightly tinning the iron and heating up each pin. You’ll feel it sink right into the tinning. It doesn’t take much heat, and very little solder. More solder will only create bridges- only the tiniest amounts are needed.
Finally, I checked for shorts one last time. I did get one short that I couldn’t clear by wiping the iron down the gap. The short was between pins on the chip, and my iron couldn’t get in there. A swipe with a dental pick cleared it right out.
If you get too much solder in an area, a quick application of solder wick will tidy it up.
I did make one more mistake in this design however, that I didn’t realize until I tried to put the device in my breadboard. The board is wide, and I knew that, but I designed it to fit on my nice wide breadboard. What I didn’t account for is that my wide breadboard is not as tall as my normal ones. The normal ones, on the other hand, are too narrow for this device. I’ll figure out how to resolve this later. For now, two breadboards will get the job done.
There’s one catch with the ATMega32U that might trip you up. I couldn’t get the chip to program through my USBtiny ISP programmer. AVRDude was giving me the dreaded “initialization failed” errors, despite all my wiring and everything being correct. Some quality time with the enormous datasheet finally revealed that, unlike most other AVRs, the ATMega32U series is configured for an external clock by default. You can’t program an AVR naked on a board unless it is running on its internal oscillator. A classic chicken-and-egg problem! I grabbed a 16Mhz TTL oscillator off the junk pile, dumped the output into XTAL1, and we were in business. Now it’s obligatory blinking LED time.
In the words of Admiral William Adama, “Significant victory”.