Tips for building and debugging your circuits

EEC 18, Digital Systems I

Pointers for Debugging Circuits

  1. The fastest way to get a design working is to spend time debugging and testing with pencil and paper, and most importantly—your brain. Turn the power off to your favorite distraction. Draw waveforms, think of test cases, and think through various modes with paper and pencil. Make sure you know exactly how each part works and be fairly confident of what is right even before you enter the design into the computer, much less load it onto the FPGA board. I guarantee your understanding will be far greater, you will have a much greater chance of it working, and assuming it works, you will be done much sooner if you do this.

    Corollary: Use the FPGA board to verify your design, not to debug it.

  2. As noted in the hardware construction section, it is often helpful to test as you build, by building sub-circuits and then testing those intermediate results before moving onto the next sub-circuit.

  3. Verify gate types are correct

  4. Verify signal polarities are correct

  5. Next, check the power and ground pins of all ICs. Focus especially on those in the area where the problem seems to be occurring.

  6. Check that enable and/or clear type signals are properly set.

  7. Check that all inputs to all the gates being used in the circuit are connected to valid logic signals (i.e., power, ground or signal). Even if the pin is not needed for the particular implementation, if it is left unconnected the circuit will often not function properly and have odd results. For example, if a three input AND gate is needed for the design, but a 4-input AND gate is all that is availabe in the ckt, the fourth input should be tied to Vdd (also called Vcc).

  8. For clocked circuits or circuits with external inputs, recheck the input signal directly from the the function generator or module (this should have been done once already before applying the signal to the circuit!).

  9. Starting with the inputs, verify all inputs to a gate then the output. If the inputs look OK, but the output is not correct, the problem may have been isolated to that gate. Check that the chip's pin(s) was not bent under the chip when it was plugged into the breadboard. You can also check this by probing the actual pins on chips rather than plugging a wire into the breadboard at a point that should connect to the chip's pin. Be careful to not short adjacent pins if you do this. If the output seems to be set at some intermediate voltage (i.e., 3 V or 2 V), there may be contention at the node. To solve this problem, remove every wire from the output in question. Retest the output. If it works with no load, add the wires back one by one, rechecking the output after each additional wire. This process should isolate which connection is causing the problem. If you are still unable to isolate the problem, contact your TA; you may have a faulty chip.

  10. Continue moving towards the output and try to isolate problems.

  11. Often adding intermediate results (i.e., additional LEDs or indicators), helps to isolate problems especially in large circuits.

  12. Go to office hours!

  13. Beat the rush, get more TA time, and get your design checked-off early.

Pointers for Building Circuits on Breadboards

** Important: Before connecting anything to a circuit, always verify the power supply voltages and input signals (i.e., function generator signals or signals from other modules) with an oscilloscope or voltmeter. Even if the instrument display seems to indicate levels are correct, this is a good practice to prevent circuit or equipment damage.
  1. Wire power and ground neatly and carefully around the perimeter of breadboards. Stick to a convention (for example, use red wires for Vdd, and black wires for ground), to facilitate debug and help prevent damaging equipment or components. Pay attention to which sections of the breadboard are permanently shorted together and which sections are not.

  2. Have the design complete prior to building the circuit. This includes a "floorplan" showing the relative placement of chips on your breadboard and a diagram showing how every pin is connected. This will help with having a neat and clean design which makes debugging far easier. You will likely spend less total time on your project if you do this first.

  3. Place all necessary ICs in the breadboard paying attention to where signals will be routed around the board. Try to avoid long wires, they can be messy and can potentially cause operational problems and induce more interference into circuits.

  4. Before starting to wire, keep in mind that long looping wires make it harder to debug and can induce unwanted interference into the circuit (especially important for analog circuits).

  5. Next, wire up power and ground to all the ICs, stick with the same convention chosen above to keep things organized.

  6. Then wire in all static signals (i.e., signals that will be wired directly to power or ground, this may be an enable signal or a load signal).

  7. Wire the remainder of the circuit trying to be as neat as possible. Remember, some extra time up front can save you from some serious headaches when debugging later on...

  8. If possible, it is often helpful to check circuit functionality as you build. Build a small sub-circuit, then test its result before moving on to another sub-circuit.



EEC 18 | B. Baas | ECE Dept. | UC Davis
Written by Bevan Baas and Ryan Apperson 
2015/03/03  Minor updates
2015/03/11  Minor updates including graying out breadboard-specific text
2021/01/01  Added several new suggestions (BB)