After populating a PCB with parts, what is the best way to debug? For example, I have an IC that requires a crystal. The IC doesn’t seem to work. What is the best way to test whether the crystal is doing it’s thing? In general I use continuity testing. Are there other techniques that you find valuable? Thank you.
I build my PCBs in stages. If I’m employing a Microcontroller on a project, I’ll make sure it is receiving power and run it configured with the internal oscillator first to eliminate variables. The datasheet for your IC should specify the correct crystal to employ and the recommended range for capacitors C1 & C2. Note: resonators and crystals are not the same.
You need an oscilloscope to do serious debugging. Check every pin of the IC to verify that it’s at the expected and correct level. Reset and the oscillator are of course key. Probing the input of a crystal oscillator can cause it to stop working, but you should be able to probe its output and see the oscillation.
you can also use an AWG/SG or other clock source (which can be almost anything) to bump a crystal or run a chip that has had its fuses changed to external clock source only, square wave and make sure the voltage match.
depending on the ic you don’t always need it it to be a fast clock to get it back to the point where you can reflash the fuses or make it start moving along.
the crystal datasheet usually tells you the recommended load capacitance that is needed, not usually the datasheet for the IC and the specified capacitance isn’t the value of the caps.
CL = ( ( CX1 x CX2 ) / ( CX1 + CX2 ) ) + Cs
CL is the load capacitance specified in the data sheet
CX1/2 would be the ideal capacitor values required
Cs being the capacitance of the circuit (stray) usually a few pF is a good start if you don’t know and its hard to tell.
The first step is to determine what it is you’re trying to check, and to know what you’re looking for.
Before you get too far in the debugging process, it helps to make a quick visual check of the board. Where there might be some doubts about an open or a close, use the meter to check and/or just rework the connection to make sure it looks good.
If you are working on a previously working design, and are having a problem with one specific board, it would help to look at the working design to get a baseline.
Otherwise, you’ll need to start taking measurements and determine if what you see makes sense. As Julia has already said, the oscilloscope is a key tool in seeing what’s happening. There are also logic probes and multimeters that can give you some indication that a switching signal is present; they might be handy, but with modern oscilloscopes being so inexpensive and portable, there’s no reason not to have one. This is especially true for circuits that involve crystals.
Make sure you also check that the power supply rail to the device is good.
It would be helpful if you say what the circuit/device that you are working on is – there may be specific things you may need to do that is particular to your design.
Just out of curiousity, what is the frequency of your crystal? You can build a colpitts test oscillator to test your crystal before you populate your pcb in the future. Occasionally I have seen a bad crystal, but it is rare! You can also use an oscilloscope or a receiver tuned to the oscillator frequency to troubleshoot. Good luck on your project.
From my experience I have never had any crystal related issues, even with capacitance values out of the recommended values. But I did encounter problems with improper clock peripheral configuration on microcontrollers. For this particular case, the oscilloscope would be the best tool to check if the expected clock frequency is present or not.
As others have pointed above, the first thing to check after assembling a pcb are voltages. (or in general, the first things to check). After assembling a new circuit, I prefer to power it from a current limited bench power supply just in case I have a short, the power supply will limit the current so I can quickly disconnect before anything is fried. I next check all the power rails to make sure they are at the correct levels.
Not sure of the experience level of the OP, so here’s a “back to basics”, debugging 101 way to look at things…
When bringing up a new PCB (actually, this applies to any debugging project), things to check IN THIS ORDER:
- Power - Make sure all your supplies are up and in regulation tolerance. Some processors have their own monitoring so of supplies to this should be good. If there are multiple supplies, you should also make sure they power mode appropriately.
- Resets - Make sure all the resets are released. If you have a design that has external resets (ie: LVR chips, etc), make sure they’re all released. Also, if the uP has internal reset control and you can check it, check to make sure you’re good to go.
- Clocks - AFTER steps one and two, then check your clocks. You mentioned oscillators, they can be notoriously fickle b**chs. There are a lot of things that can mess with them. I’ve had things like changing a PCB supplier cause an oscillator to not start up (PCB manufacturing stackup changed which altered the impedance of the circuit to where it was out of balance because it wasn’t designed to handle the differences). Have you kept ground planes out from under your oscillator circuit on all layers? Someone above quoted the equations and thats great if you know the variables. Unfortunately, most ICs that drive an oscillator don’t give you all the bits you need (like output impedance). So, in general oscillator circuits involve a lot of testing, guessing, and black magic.