Isolating Problems

Another important rule is to find a reliable way to reproduce a problem. If your circuit behaves in a funny way at random times, try really hard to identify what seems to cause this. Does it happen only when you press a switch? Only when an LED lights up? Whenever you move a jumper? (Many problems are caused by loose wires, either not connecting where they should, or connecting where they shouldn’t.) Try to repeat the steps that cause the problem, paying attention to small details and making one change at a time: does it happen every time the LED lights up, or only if you press the switch while the LED is on? This process will allow you to think about a possible cause. It is also very useful when you need to explain to somebody else what’s going on.

Loose connections are notoriously difficult to find. Try gently wiggling different parts of your circuit and when you identify a region that affects the problem, slow down and wiggle one wire or component at a time.

Describing the problem as precisely as possible is also a good way to find a solution. Try to find somebody to explain the problem to—in many cases, a solution will pop into your head as you articulate the problem. Brian W. Kernighan and Rob Pike, in The Practice of Programming (Addison-Wesley, 1999), tell the story of one university that “kept a teddy bear near the help desk. Students with mysterious bugs were required to explain them to the bear before they could speak to a human counselor.” If you don’t have someone (or a teddy bear) to talk to, start writing an email describing your problem. This isn’t time wasted, because (a) it often leads to solving the problem and (b) if you need to ask someone for help, you will be prepared


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *