Page 182 - The Art of Designing Embedded Systems
P. 182
Troubleshooting 169
crystallize your thinking-if it is right, you’ll know what step to take next.
If it’s wrong, collect more data to formulate yet another theory.
Step 6: Fix the bug.
There’s more than one way to fix a problem. Hanging a capacitor on
a PAL output to skew it a few nanoseconds is one way: another is to adjust
the design to avoid the race condition entirely.
Sometimes a quick and dirty fix might be worthwhile to avoid getting
hung up on one little point if you are after bigger game. Always. always re-
visit the kludge and reengineer it properly. Electronics has an unfortunate
tendency to work in the engineering lab and not go wrong until the 5000th
unit is built. If a fix feels bad, or if you have to furtively look over your
shoulder and glue it in when no one is looking, then it is bad.
Finally: never, ever, fix the bug and assume it’s OK because the
symptom has disappeared. Apply a little common sense and scope the sig-
nals to make sure you haven’t serendipitously fixed the problem by creat-
ing a lurking new one.
Speed Up by Slowing Down
There he sits. . . the organization’s engineering guru, respected but
somewhat feared because of his arcane knowledge. His desk is a foot deep
in paper, the lab bench a mess of old food containers and smoldering sol-
der drippings. Tools and resistor clippings threaten to short out any test
system carelessly placed on the bench. Wires crisscross every square inch
of tabletop-scope probes, clip leads, RS-232 cables-all going some-
where . . . though perhaps no one really knows their destination.
Ask the guru for a piece of paper and be prepared to wait. He burrows
frantically through the mess. Usually the paper never comes to light. It’s
lost. Don’t worry, though-he’ll recreate it for you as soon as he has a
chance. Probably the PAL equations he’ll come up with will be about
right, but if they’re not-no problem! He’s already debugged that circuit
twice, so he’s quite the expert.
Too many managers tolerate this level of chaos. Me, I’m a reformed
lab pig. My 12-step recovery program revolved around living in tiny
places-a VW microbus, many boats-which force you to be organized
simply to deal with the incredible lack of living space. There’s no room to
be a slob on a small sailboat! Fortunately, my personal quest for organiza-
tion rolled over into the lab when I discovered just how much time I saved
by putting things where they belong.
Mess and clutter quite simply decrease productivity. Those few min-
utes a day spent putting things away save hours of searching. Sweep the

