General purpose oscilloscope helps with low speed serial bus debugging

4 mins read

Using an oscilloscope to analyse and debug a low speed serial link is standard fare and today's general purpose digital oscilloscopes contain a variety of features that allow the user to quickly verify a link or to troubleshoot a faulty system.

Serial decoding packages are great tools for functional verification, but may not help to isolate a parametric problem on the bus. Also, users may not need to jump to the serial decode application in order to get a specific measurement. Is there any activity? When first turning on a system or troubleshooting a faulty board, a user will want to know if the bus signal(s) toggled when the switch was flipped or when a routine was executed. Roll mode, a simple but under used oscilloscope feature, provides a quick indication of signal activity without having to set up any trigger. Roll mode with peak detect provides confidence that signals as narrow as 500ps will be captured. Figure 1 shows a spi bus used to program a PLL circuit with three words during a power up sequence. The oscilloscope is set to roll mode at 200ms/div in peak detect acquisition mode. The peak detect circuitry is running at 4Gsample/s and storing min/max pairs at 250ksample/s. Power is applied to the board and the acquired data shows three separate packets of activity on all three bus signals. If the user desires to trigger in normal acquisition mode while looking for activity, the trigger type 'OR' – available in the InfiniiVision 3000-X series – can be used. With this trigger type, either or both slopes of any of the available trigger source can be enabled. For example, both rising and falling edge slopes on channels 1, 2 and 3 in fig 1 could be enabled. This trigger is useful because it is a functional 'or' of channel edges, not a logical 'or' of trigger comparator states. This means a high level on an enabled channel will not mask triggers from other enabled sources. How many clocks? Often, users will want to count the number of clock cycles or edges in a packet from a serial bus that contains a dedicated clock such as spi, µWire or i2c. Fortunately, most general purpose 'scopes provide two methods of getting this information. The first is to use the measurement system and count edges, pulses, or both. The burst captured in figure 2 measures the number of clock cycles (and edges) of a long register programming stream into an fpga (which should be 540). Automatic measurement markers provide confidence by indicating the first and last pulses. The other method is to use simple trigger sequencing. The user can measure the number of edges indirectly or trigger on a specific clock edge within a packet by using this sequencing. For example, in the 3000-X series, the mode 'Nth edge burst' is useful for triggering on a non continuous clock signal. In this mode, the trigger system must first find a period of no activity on the signal. This time is set by the 'idle' control softkey, which has a range from 10ns to 10s. After the idle time requirement has been met, the trigger will occur on the desired edge count within the pulse stream. This count can be set from 1 to 65,535 by using the 'edge' softkey. The slope can be rising or falling. In fig 2, the oscilloscope triggers when the count is set to 540 or less, but not if the count is set to 541. For systems with continuous clocks, the 'edge then edge' mode can be used to trigger on a specific clock edge. In this mode, the trigger system sequences much like 'Nth edge burst' but, instead of looking for an idle, the system looks for an edge such as a chip select in a spi bus. Know your scope's update rate General purpose scopes are, first and foremost, viewing tools. Having a scope that gets data to the screen with minimal dead time is invaluable when viewing waveforms and spotting problems. Fig 3 shows an spi bus clock from a system that exhibits periodic failures. At first glance, the signal looks normal and the user is tempted to look elsewhere to find the issue. However, putting the scope in infinite persistence mode and allowing the waveform to build shows an intermittent glitch (fig 4). The ability to see the glitch is solely down to the scope's ability to get data to the screen. For example, a scope that updates at 1million waveform/s will show that elusive glitch 1000 times more quickly than a scope that updates at 1000waveform/s. The median time for the glitch to be captured is approximated by the equation: 1 / (scope update rate * screen time * signal rate) which, in this example, is: 1/(10^6 * 20ns * 20Hz) = 2.5s A scope which updates at 1000waveform/s would have a median time of 41mins. Once the glitch is seen, it is important to trigger on it to correlate with system events. Specialty trigger types – such as glitch, runt, setup/hold and transition time – may be useful here. Probing Poor probing can obfuscate the verification process, leading to wrong answers and increased debug time. In general, it is best to have the shortest ground lead possible when using a single ended probe while making parametric measurements. Not only does a long ground lead decrease the bandwidth of the probing system, but measurements are also susceptible to circuit noise, ground bounce and esd. When probing, the user can be fooled into thinking there is a problem in the circuit when there is none. To determine how much background noise might be seen with a given probing configuration, probe ground on the target (both probe tip and ground lead connected to the same node on the DUT). When it comes to esd and other non circuit noise, the probe with the long ground lead is very susceptible. It is easiest to see this by putting the trigger mode to normal and setting the trigger level above or below the baseline level. Most users of low speed serial bus decoding know that getting time aligned information is most useful for two measurement scenarios: bus content verification; and correlation with other system signals and events. With this in mind, the signal requirements for the decoder are different than for parametric measurements. With the possible exception of i2s and spi, most serial bus clock speeds or bit rates are sub MHz. Allowing the scope to acquire these signals at full bandwidth is undesirable when the bus parametrics have been verified and are not of concern. So put the measuring channel(s) into BW limit; not only will this help to minimise the scope's inherent noise, it will also reduce the effects of using long ground leads. Knowing your oscilloscope's capabilities and features can greatly reduce the time you need to use it. With the right toolset, you can quickly verify operation or locate a problem. Tom Schmidt is the triggering and hardware assisted serial decoding architect for Agilent's InfiniiVision oscilloscope range. For the full article and illustrations, please download triggering.pdf using the link below