Go here to sign up for The Embedded Muse.
Logo The Embedded Muse
Issue Number 235, February 4, 2013
Copyright 2013 The Ganssle Group

Editor: Jack Ganssle, jack@ganssle.com
Jack Ganssle, Editor of The Embedded Muse

You may redistribute this newsletter for noncommercial purposes. For commercial use contact jack@ganssle.com. To subscribe or unsubscribe go to https://www.ganssle.com/tem-subunsub.html or drop Jack an email.

Contents
Editor's Notes

The average embedded software project devotes 50% of the schedule to debugging the code. It's stunning to realize that half of the project's time is wasted fixing mistakes.

Perhaps the other half should be called "bugging."

Unfortunately that debugging just doesn't work. Most organizations ship with about ten bugs per KLOC, two orders of magnitude worse than best-in-class outfits. A focus on fixing bugs will not lead to a quality product.

How do you get projects done faster? Improve quality! Reduce bugs. This is the central observation of the quality movement. The result is a win-win-win: faster schedules, lower costs and higher quality. Firmware engineering, too, can - and must - profit from the same win-win-win.

Learn how (and far more) at my Better Firmware Faster class, presented at your facility. See https://www.ganssle.com/onsite.htm.

Quotes and Thoughts

Engineering ... it is a great profession. There is the fascination of watching a figment of the imagination emerge through the aid of science to a plan on paper. Then it moves to realization in stone or metal or energy. Then it brings jobs and homes to men. Then it elevates the standards of living and adds to the comforts of life. That is the engineer's high privilege. Herbert Hoover, 31st president of the United States.

Tools and Tips

Please submit neat ideas or thoughts about tools, techniques and resources you love or hate.

The number of suggestions for maintaining a knowledge base has been incredible and continues. Bob McConnell wrote this:

 

A long, long time ago, there was an MS-DOS application called "Tornado Notes" that I loved. It installed as a TSR so it could be pulled up anytime. It also had an incredible search filter, the likes of which I haven't seen since. It was ported to MS-Windows as "Info Select" which my manager thought was too expensive for us (but not for him).

The nearest I have been able to find to either of those is a Java application called JreePad. Because it is Java, it will run anywhere you can find a JRE. I have it installed on all of my Linux workstations at home, but can't use it at work due to IT restrictions.

Reinhard Kopka added:

 

I also use Evernote since I have an Android phone. But more for the info to be used in the near future.

For more in depth info to be stored for longer times I use Wikidpad. It’s standalone, but needs a SW. I’m still not entirely fond of the Cloud thing. You also need to synchronize always or you get to sort out the different info.

So I prefer to have my info on my USB stick with me. It’s also more secure and always in sync (on this stick). For mobile use there is an Android app in work (but not really useable, yet) and you can publish the WIKI as a HMTL version to be read by any browser.


Quantum Leaps

What I'm Reading

Jim Turley is probably the best writer in the electronics industry. His latest on the problems with Java is interesting.

A Decade of OS Access-control Extensibility - practical experience deploying security policies in several framework-based products.

IC Ad

Analog Discovery Update

In Muse 233 I reviewed Digilent's Analog Discovery, a digital scope, logic analyzer, pattern generator and twin waveform generators (AWG) all rolled into one. I wasn't too fond of the "probes," which are just wires from a connector. Now the company has released their Analog Discovery BNC Adaptor Board, which plugs onto the scope unit and provides BNCs for the two scope and two AWG channels. The following picture shows the board connected to the instrument; above are the pseudo-probes that come with the Analog Discovery.

BNC Board for the Analog Discovery

Blue jumpers select AC or DC coupling for the scope channels. Those on the AWGs configure 50 ohm outputs or a confusing 0 ohms (one thinks of a short to ground but this is the series resistance).

In the following screen shot I've used the wire clip leads normally provided with the Analog Discovery to connect a waveform generator to a scope input. This is a 20 KHz square wave.

Scope trace of Analog Discovery with clip leads

In the next picture I removed the clip leads and installed the BNC adaptor board, and ran a coax from the waveform generator to the scope input. The signal looks a lot better.

Scope shot of Analog Discovery with BNC board

Notice the header on the right side of the BNC board? All of the instrument's signals, other than the scope and AWGs, go to that so you can access them using the standard leads. It's a nice touch.

A bench scope will sense what kind of probe is detected and rescale the vertical axis so the user doesn't have to mentally compensate for a X1 or X10 probe. This board doesn't do that, which is unsurprising considering its price.

The BNC board is a terrific boon for using conventional probes and at $15.99 is a bargain.

Best C Book?

Last issue a reader asked what is the best C book. Lots of people answered, and it's pretty clear that "C: A Reference Manual" is the most popular. Here are some responses:

Larry Eaton wrote:

 

The C reference I've been using for years is The C Programmer's Handbook. It does not go into C++ - but it is extremely easy to use - the index is right on the cover, and it's spiral bound for constant and easy reference. I use it for things like obscure syntax for sscanf(), declarations, etc.

From Scott Whitney:

 

I always keep a copy of Harbison/Steele's "C: A Reference Manual" by my desk. It's clear, concise, and provides lots of excellent examples and rationale. There is also a companion web site that contains links to even more references. Now in its Fifth Edition from Prentice-Hall.

Michael Burr had several suggestions:

 

I think that hands down the best C reference book is Harbison and Steele’s “C: A Reference Manual”:

I have several copies of various editions floating around my office and home. They don’t get used as much as in the past because online sources are so good, but I still think it’s the single best C reference.

The C standard is a also good reference but is not an easy read and only talks about the specific standard (no common extensions, POSIX or old standards, for example). A PDF version for C99 is freely available here as WG14 N1256 – it’s the C99 standard with TCs 1, 2 and 3 incorporated.

You can purchase a PDF copy of the new C11 standard for $30 here.

See this for some details on C++ standards and the C90 standard.

Phil Ouellette sent this:

 

I find myself continuing to return to an old copy of SAMS The Waite Group’s New C Primer Plus dated 1990. It is aimed at PC programming (as in MS-DOS), but it is so well organized that it is still my goto C reference.

My old copy has been so used and abused that I rebound it in order to be able to keep using it. It cost me all of $27 back in the early ‘90s. Best value of any book I have ever purchased. It is up to the 5th edition, but I have yet to feel the need to upgrade.

You can get a copy of the initial version (the version I have) for $4.

The 5th edition is available for $31. I wonder if the update is worth $26?

Philippe Auphelle is another fan of Harbison & Steele:

 

I use K&R's The C Programming Language, Second Edition, and Harbison & Steele's C, A Reference Manual, Fifth Edition.

The latter does a good job covering the C99 standard in a more readable way, IMHO.

Ray Keefe sent a long and interesting email about a number of subjects. As for books, here's his take:

 

I find “The C Programming Language, Second Edition” to be a great reference. I originally learnt C because the company I was joining made it a requirement that I learnt it before I joined. The book I used for that “The C Primer” which is also very good.

Some recent books I bought that are useful to have are:

- Test Driven Development for Embedded C

- Design Patterns for Embedded Systems in C which I see you are already familiar with

I still have a copy of “C The Complete Reference” by Herbert Schildt (1988) and although it doesn’t cover C99 improvements it still gets used.

Mark Peters wrote:

 

Regarding your question about best C book, my go-to book has always been Harbison and Steele "C: A Reference Manual". I haven't looked at the newer fifth edition (2002) to see how it covers newer developments though.

USB Instruments - Be Careful!

Ray Keefe shares others' experience with blowing up USB instruments:

 

Agreed about USB based instruments. I’ve even taken out a laptop when a piece of equipment I was working on had a large transient and this couple through the USB and back through the charger. It would most likely have been OK if I wasn’t charging but there was obviously enough transient coupling in the charger. The transient was the voltage drop across an 18AWG cable when a 25KV power distribution switch turned on and the X2 input capacitor pulled 100A for 1usec and put a 30V drop across the cable acting as the neutral reference. A Tektronix 200MHz CRO captured the event very nicely including a LEM based current measurement and it survived and is in good shape still.

That being said, tools like the Saleae USB LSA is a fantastic light weight LSA and very portable.

On the down side, recently moving to Windows 7 means that we have USB based instruments that no longer work because there will never be a Windows 7 driver released for them. So we have an XP based laptop we are likely to keep forever (meaning 5 years top) just to keep supporting these. This includes some digital oscilloscopes.

Jobs!

Let me know if you’re hiring embedded engineers. No recruiters please, and I reserve the right to edit ads to fit the format and intents of this newsletter. Please keep it to 100 words.

Joke For The Week

Note: These jokes are archived at www.ganssle.com/jokes.htm.

Fred Strathmann sent this:

Three men: a project manager, a software engineer, and a hardware engineer are helping out on a project. About midweek they decide to walk up and down the beach during their lunch hour. Halfway up the beach, they stumbled upon a lamp. As they rub the lamp a genie appears and says "Normally I would grant you three wishes, but since there are three of you, I will grant you each one wish."
The hardware engineer went first. "I would like to spend the rest of my life living in a huge house in St. Thomas with no money worries." The genie granted him his wish and sent him on off to St. Thomas.

The software engineer went next. "I would like to spend the rest of my life living on a huge yacht cruising the Mediterranean with no money worries." The genie granted him his wish and sent him off to the Mediterranean.

Last, but not least, it was the project manager's turn. "And what would your wish be?" asked the genie.

"I want them both back after lunch" replied the project manager.

Advertise With Us

Advertise in The Embedded Muse! Over 23,000 embedded developers get this twice-monthly publication. .

About The Embedded Muse

The Embedded Muse is Jack Ganssle's newsletter. Send complaints, comments, and contributions to me at jack@ganssle.com.

The Embedded Muse is supported by The Ganssle Group, whose mission is to help embedded folks get better products to market faster.