Ye Hardware Engineer on Quest for Firmware

I've been spending some time with the mbed here and I'm convinced that there are a lot of good uses for this little thing. One in particular popped in to my head with a lot of vigor.

Back in December of 2008, I listed ten (Octal) things to do to help get through a lousy economy (read #3). If you're pretty much a pure hardware engineer, now might just be a good time to develop some firmware skills.

In my mind, one of the biggest problems going from hardware to firmware isn't the programming itself. That's not really as tough to pick up as you might think. But it's the environment. The tool chains. The configurations. Make files, environment variables, linked libraries, boot loaders, ICSP, flag bits... There's a load of ancillary junk that gets in the way. Some micros require purchased proprietary compilers. Some use open source. Should you use C or C++ or ASM? Too many choices.

Well, here's something that gets rid of all of that extra junk. Plug in an mbed and in minutes you can be experimenting with C programming on an embedded micro controller. Use the onboard LEDs and sample programs to get instant gratification. Plug in some external LEDs or a sensor of some type (maybe from sparkfun) as you get a little more versed in the language. Save the data to the FLASH and graph it in Excel or something.

My personal feeling is that a hardware engineer is much more employable these days with the ability to write firmware. I haven't found a better way to get started then with an mbed. You can worry about all of the other details later, but use this little guy to teach yourself to code.

Duane Benson
It's been a soft day's night, and I've been coding like a frog

My mbed Is Up

I wrote about the new mbed development board a while back and mine just arrived over the holiday weekend. I have to say, true to it's promise, It was the easiest piece of development hardware that I've ever brought up:

  1. Take it out of the shipping box
  2. Plug in the USB cable to the board and my computer
  3. Wait a minute for it to be recognized and open up like a USB thumb drive
  4. Double click on the web shortcut in the drive
  5. Register
  6. Click the Compiler link
  7. Pull up a code sample and modify it a bit (I didn't need to modify it, but I did anyway)
  8. Click the compile button
  9. Save it to the mbed as though it were a USB thumb drive
  10. Press the reset button on the mbed board

That's ten steps, but it's only ten steps. There was nothing else to do. Nothing. The longest step was number seven which took me about two minutes. I programmed a "Knight Rider" sweeper with the four on-board LEDs. I made one of those for my Jack-o-lantern back at Halloween, so it was the first test program that popped into my head.

I built the Jack-o-lantern sweeper with eight LEDs and an 8 bit PIC16F819. The PIC I used came in an 18 pin thru-hole DIP package, costing $3.22 at Digi-Key, and I hand soldered it all on an old perf board. It runs at 20MHz, has 16 GPIO, 3.5K program code space, 256 bytes of FLASH and 256 bytes of RAM.

Mbed pinout The 32 bit NXP LPC1764 runs at 100MHz in a 100 pin LQFP and costs $8.70 in quantity of one at Digi-Key. (The dev board, of course, costs more then that) It has 512K of program FLASH and 64K of RAM. The dev board can have up to 25 GPIO (the chip can have up to 70 GPIO with your hardware) along with the standard assortment of peripherals that can be configured, including six hardware PWM channels. The mbed dev board is like a breakout board configured as a 40 pin 0.1" DIP so it will be easy to prototype with.

The processor, being a fine-pitch package really isn't hand-solderable like the PIC except for by the most adventurous of folks, but that's where Screaming Circuits comes in. Why wait for your custom hardware before starting on the software. Get one of these mbed dev boards to work on your software while the EE folks are designing the custom hardware. Then, when they're done, we'll assemble up the prototypes and you can integrate it all together. Take some time out of your development schedule that way.

I've wanted to try out an ARM processor for quite a while, but prior to this, haven't found the right way to do so while keeping within the limits of my time availability and skill set, but this looks like it could very well do the job.

Duane Benson
Robots rule!


What it is...

Dan got it. As for what it has to do with PCBs, well, not a whole lot except that my desk was all messy that day so I was using the carpet as a backdrop to photograph a pc board.

What it is Misc components on boards

Yes. I know. It's a trick question, and not all that interesting in the end, but I was suffering from lack of sleep that day. I thought it just looked cool and so it seemed like a good idea at the time.

Duane Benson

What is it?

What Misc components on boardsWhat is this and what does it have to do with PCBs?

As you ponder that question, if you care to ponder that question, keep in mind that I have at my disposal, not just the work of my company, Screaming Circuits, but I have the entire Internets to draw from and the Internets have photos from all of the history of electronics. So, this photo might actually not relate directly to via-in-pad or small component tombstoning.

There will be no prize for the correct answers, but you will likely get at least 3.2 picoseconds of fame if you post your answer as a comment here. And while a picosecond may not seem like much, if you could save picoseconds in a leyden jar, and then do the same over and over again, you could eventually end up with a usable duration.

Duane Benson
To have enough time
to do the things you want to do
you just need a fast enough internal clock speed

Friday The 13th

I'm always writing about stuff that goes wrong (and, hopefully doing a decent job of describing how to avoid such problems). But here it is, Friday the 13th - the traditional bad day of bad days. Break a mirror and watch a black cat cross your path while walking under a ladder.

Or not.

Good QFP Here's a QFP part we soldered on. The land-pattern was right. The size and spacing was good. The pad size was good. The fillets all look good. The solder-mask registration is good. No problems. It's an IPC, class II job and everything meets IPC class II. Cool.

Good BGA pads No vias in these BGA pads. No open vias without mask near the pads. Decent registration on the soldermask. Nice, planar surface on the pads. Even the vias between the pads are plated over and masked off.

The via caps do look kind of funky, being bigger then the BGA land pads, but that's okay. It's just a nice decent silver finish PCB. And, no tarnish or surface contamination to be seen anywhere.

Duane Benson
Hmmm. Interesting.

Microcontroller In The Middle

I've written about Open Source hardware before, such as the beagleboard and Arduino. Those are both great options for folks needing to get moving on embedded microcontroller development. The Arduino is Mbed-microcontroller-angledpretty low-end and the Beagleboard is pretty high-end. I think I've run across a good step right in the middle.

A while back at the ESC show, we spoke with a gentleman from ARM about a project that would include an online IDE, and now, here it is. It's not exactly the same as open source, but it solves many of the same problems that open source solves. Mainly, it's a quick and easy way to get up and running with an ARM processor. Well, it looks easy, anyway. I haven't tried it yet. I think I'll see if I can get one and give it a shot.

By the way, we did not build this board. We have built some Beagleboards, but not this particular product. It certainly wouldn't be a problem for us, but that's not why I'm writing about it. It just looks like a great half-way point between something like the Atmel-based Arduino (or the PIC microcontrollers that I use) and the Beaglboard which uses the super-speedy ARM Cortex-A8.

If I can run one down and find the time to fiddle with it, I'll let you know what I think of it in actual use.

Duane Benson
Stay tuned. Bulletins as event warrant.
Maybe...

Speaking of Art in the Process

I really like this picture. It's nothing particularly special. Just a BGA-type attachment point of load (POL) power module in the middle of a big PCB, but the contrasting colors, the angle, the range of focus, the component positioning...  It just looks cool to me.

PTH05060 on boardI know the function is supposed to be the most important thing, but I've always felt that there is a lot of art in PCB design. It's been said that an airplane that looks good will fly good and I think there's something in that phrase for electronics too.

No. I'm not advocating putting the visual appeal ahead of clock rise times, trace impedance and current capacity. It is first and foremost, an electronic device with an important function to deliver. But, I think a visually attractive, while still superbly functional, product makes a statement about the designer's overall attention to detail.

Duane Benson
Or, it might just be making a statement about how tight the development schedule is...

And, Another Thing...

I got a couple of pretty thorough comments on my copper pour post over in the Circuits Assembly blog where it's also posted.

David le Comte wrote:

"...On two layer boards (with 5V CMOS logic in particular) it is very difficult to pass CISP-22 EMC tests without a well grounded flood plane.

In the 1980s it became a requirement for more and more categories of electronic equipment to be tested for EMC compliance.

From first hand experience, I have seen how just adding a flood plane to two-layer boards can reduce EMC by 20dB. (We had to revise existing boards to pass EMC tests during the late 80s and 90s)..." (See his entire comment on the Circuits Assembly blog link above)

That brings up a very good point. EMI. In the prototype/experimental world and the hobby world, there are so many cases where EMI isn't too much of an issue. We don't always think about it. If your project is going into a consumer or business consumer product, no questions, though, EMI is a big consideration. As David indicates, a grounded pour or plane can go a long ways toward keeping stray interference down.

I wonder if an Arduino could pass any EMI standards. Has anyone run it through a lab? Maybe with some good shielding. I bet the "Knight Rider" teeth I made for my pumpkin this Halloween (with a point to point wired PIC16F819) just radiates all over the place.

Duane Benson
Pore, pour, pitiful me

Pour Or Not - Just What Is My Opinion?

I posed a question about using copper pours (AKA flood) a not long ago. The premise was a simple microcontroller board with a 20MHz clock and no special requirements.

Cooper pour exampleI had a couple of different comments on the post with some very good insight. Myself, I generally don't use copper pours. My only reason is that I think it usually looks better without. Although, I do like the look of the cross-hatch pour on the Arduino. A well done flood can be pretty cool, but still my inclination is to only use it if it's needed. If it's a shop doing the PCB, the metal will be recovered and recycled, so the conservationist in me is pleased.

If it's a home etched deal, then a pour is probably a better idea because it will reduce the amount of etchant needed. Although you do need to be careful to keep plenty of space between things to prevent solder bridges. Solder bridging isn't such a big deal on a PCB with a good solder mask, but it certainly is on a board with no mask or thin mask.

If there is a good reason, I will. Like a high-current motor driver - I use the pour to keep the current capacity up and the kelvons mellow. Heat sinking is a good reason for a pour. Hi speed stuff usually benefits from a flooded plane of some sort too and in four-layer boards, using the inner planes for power and or ground is nice and convenient. But you all know that. I'm just rambling now.

Duane Benson
Does high speed stuff on a flooded plane require a speed boat?
Will too much heat sink it?

To Pour, Or Not To Pour. That Is The Question

Pcb w o pour Pcb w pourI know there are plenty of times when a copper-pour ground or power plane is a good idea, sometimes even a requirement. But, is it always so? Take a simple embedded microcontroller board. It has a 20MHz clock speed. Nothing too dramatic. No big power drains anywhere. Just milliamps going here and there.

Does it still help? What about the "greenness" of it? If more of the copper is etched off, more metal will be recovered from the fab company's chemical vats. Or does the additional etch time and and acid required for clearing the board of copper outweigh the benefits of the additional recovered copper?

Looking at all of the boards we get through our assembly lines here, I can't really tell a general industry preference. It's hard to detect an internal plane visually and surface pours don't seem to be any more popular then the lack of them. So, I don't know what the world says.

Any thoughts on this? Anyone? Anyone?

Duane Benson
Bueller...
Bueller...
Bueller...