With the explosive growth in the use of microcontrollers, engineers who design products in fields ranging from computers to industrial electronics need to test and debug circuits that include low-speed serial data lines, high-speed data streams, or both. In addition, often there is a need to test and troubleshoot the timing of 8-bit or 16-bit wide address/data buses as shown in Figure 1.
Figure 1. Typical Embedded Systems Environment
For several years, there have been tools called mixed-signal oscilloscopes that can use four input channels with 8-bit ADCs to capture analog-shaped signals using one part in 256 vertical resolution and provide up to 36 lines for capturing digital buses as being either logic high or low. Some of the newer oscilloscopes also can capture multigigabit/second high-speed serial data streams. This allows a design or test engineer to use a single instrument rather than a combination of a low-speed oscilloscope to decode I2C, SPI, or RS-232; a logic analyzer to test the address/data buses; and a high-speed oscilloscope for jitter/eye pattern testing of high-speed data.
The net result is easier triggering on the event of interest, faster spotting of circuit problems, and higher confidence that a design is working properly. The bottom line is getting products to market faster, simplifying test equipment setup, and saving money in the capital equipment budget.
Mixed-Signal Testing
Many microcontrollers used in embedded systems are 8-bit devices. But in addition to the address and data lines, you often need to test the status of an enable, clock, or other digital level. Consequently, a test system that can handle a total of 18 digital lines often is desirable. Similarly, in a 16-bit system, the use of up to 36 digital lines may be useful.
Sometimes, the engineer needs to look at just the high and low voltage levels and timing of all the lines to make sure everything is correct. As digital signals become faster, it often is desirable to examine the analog properties of a digital signal such as its rise time, overshoot, and ringing.
Other times, the interesting part is figuring out how to trigger on a combination of the states of digital and analog signals or to prequalify a trigger event by a certain digital state on the bus. For example, an engineer might want to trigger the oscilloscope on a certain value on the data bus but only after a particular address has occurred on the address bus.
You can specify logic high, low, don’t care, or any edge for each of the input signals on some scopes. This is not as powerful as the triggering available on logic analyzers but suitable for many applications of the type shown in Figure 1.
It also is possible to specify a subgroup, such as a certain address or data value, and tell the oscilloscope to trigger on a certain bus value like trigger on an address of 4C. In Figure 2, the portion of the waveform highlighted in red, the address portion of the waveform, has been decoded as a 4C, and the trigger time marker, a small yellow triangle below the waveform, is located at the end of the address value.
Figure 2. Triggering on an Address = 4C
Once the trigger is set up to capture the event of interest, you can view both the analog and digital signals on the screen of the oscilloscope. The analog signals are viewed in the normal way, by turning on channels 1 through 4. The digital signals can be viewed as individual logic lines or in bus groups.
For the oscilloscope to determine whether a digital line is high or low, you must give the oscilloscope a definition of the voltage levels. You can define one line or a group of lines as conforming to a certain protocol, such as SPI or RS-232, which the oscilloscope understands; you can specify a certain logic family such as TTL or ECL; or you can tell the oscilloscope which voltage corresponds to high and low for each input.
For example, you can define D0-D7 as an eight-line digital group, perhaps address lines or data lines. The group can be turned on or off the screen display with a single touch. You also can toggle back and forth between viewing all eight lines in the group as individual traces or displaying the group as a single trace depicting the value of the group vs. time. Turn on all 8 or 16 individual traces if you are checking the timing of all the bits on the data bus.
If your next step is to check the detailed status of the address bus, you should collapse the lines of the data bus into a single trace. That way you have a lot more room on the oscilloscope screen to examine the 8/16 traces of the address bus. You still can see the value of the data bus and the timing of the transitions of the bus value, but in the collapsed mode there will be a single trace showing the aggregate value of the bus lines rather than individual traces for each bit.
You can make cursor measurements on the digital lines the same way as on the analog inputs, and you can call up parameter measurements on digital lines, such as pulse width, duty cycle, and delay, in the same fashion as for analog signals. If you want to measure the analog properties of a digital signal, the signal needs to be attached to one of the four analog inputs of the oscilloscope.
For example, to measure overshoot on a digital signal, you need more information than high and low. If you connect the digital signal to one of the four front-panel BNC inputs, the oscilloscope will capture the signal using an 8-bit ADC and show details, such as overshoot or ringing, and you can apply parameters to measure those properties.
Decoding the Data
Many engineers who test semiconductor devices or higher-level products that incorporate low-speed serial data communications spend lots of time looking at their signal, writing down strings of digits, and then translating those digits into commands. This can be quite time-consuming and is subject to human error.
Translating strings of ones and zeros into useful messages is a job that can be handled much more quickly and accurately by a program such as the ones available in many types of oscilloscopes. Packages are available to decode I2C, SPI, RS-232 or generic UARTs, CANbus, Flexray, LIN, and other types of protocols.
A useful way to start testing or troubleshooting a low-speed serial data signal is to trigger on an event of interest and look at both the clock line and the address/data lines. You probably should use one of the front-panel analog inputs to look at the clock. That way you can see any problems with glitches, excessive noise, rise times, overshoot, or ringing.
Once you have examined the clock and made sure it is working properly, the bulk of the engineering time usually is spent in testing the operation of the device when sending various addresses and data values. It is useful if the mixed-signal oscilloscope can remove the clock signal from the display and use the entire display area to look at the traces showing the information from the digital lines.
A fairly simple example is shown in Figure 3. The upper trace is CANbus and the lower trace is Flexray. On some oscilloscopes, up to four protocols can be decoded and displayed simultaneously. In addition to performing the decoding, such packages also allow you to set up triggers based on the decoded data such as trigger on start, stop, restart, a certain address, a certain data value, an error message, or a NACK.
Figure 3. Captured and Decoded Signals of Two ProtocolsThe orange (top) and yellow (bottom trace) are the voltage vs. time waveforms normally seen on oscilloscopes. The highlight colors and black text are decoded by the scope to save time and possible human error.
One of the most important troubleshooting features of a mixed-signal oscilloscope is the capability to trigger on a decoded feature of interest and allow you to see signals happening both before and after that event. If there is a NACK or some other type of error, you can see what happened prior to the problem and how well the circuit recovered when faced with the error.
There are various important measurements that become more accurate and faster to execute when using a mixed-signal oscilloscope. For example, the oscilloscope can measure latency time between a point on one signal, either analog or digital, and a point on another.
If you were designing the electronic braking system on a car, one of the key measurements might be the time elapsed between the analog signal of pressure on the brake pedal and the activity on the CANbus sending commands to the brakes on the wheels. Since this is a very important measurement, the engineer should capture this event many times and look at a histogram of the distribution. This gives insight into the overall operation of the product in addition to proving if the device meets specification and its margin.
You can measure parameters, statistics on parameters, look at long time acquisitions using roll mode, or create histograms showing the distribution of timing or voltage measurements on the digital signals, analog signals, or a mixture of analog and digital signals. You also can perform tests in which there is a slow-term variation in temperature, supply voltage, or some other factor and ask the oscilloscope to draw trend lines showing the time evolution of key parameters.
Troubleshooting High-Speed Serial Data
In the upper left of Figure 1 is a connection to a high-speed serial data bus. This might be SAS/SATA to send or retrieve data from a storage device; it could be a PCI Express connection to a video card or a number of other types of multigigabit/second serial data protocols. Although these data communications connections perform the same basic function as lower speed buses, the methods of testing or troubleshooting them tend to be different than for low-speed buses. At higher speeds, the positions of edges must be very tightly controlled to meet the specifications set down by the standards committee.
Basically, the transmitter and receiver need to accommodate minor variations in the data rate and low levels of noise on the signal. But if edges get too far out of position or have too much noise, then the circuit can make errors in transmitting the bits. In the first generation of PCI Express, the data rate is 2.5 Gb/s so the entire length of a bit is 400 ps. It doesn’t take much of a shift in edge position to cause trouble when data comes at that rate. Second-generation PCI Express runs at 5 Gb/s, and tolerances are even tighter.
One type of test that has been difficult in the past is checking for proper response in the high-speed serial data output of a device in response to a control command sent on a low-speed serial data bus. One method was to use two oscilloscopes: one to trigger on and capture the low-speed signal and another to trigger and capture the high-speed signal. This could be quite complex. Now, a single instrument can trigger on either type of signal or a combination of both and can display, measure, and analyze both types of signals.
Figure 4 shows an example of troubleshooting a PCI Express Gen 1 serial data stream. The oscilloscope captures hundreds of thousands of continuous data bits with no dead time and measures the position of every edge. It then recovers the embedded clock and compares the position of each data edge to its local clock and calculates the difference between the actual edge position and where the edge should have been if it were ideally located with respect to the local clock edge.
Figure 4. Track of the Parameter TIE for a PCI Express SignalThe lower right of the image shows the time between the dotted line cursors corresponding to a frequency near 300 kHz.
The string of numbers defining the error in data edge positions is the green trace shown on the screen in Figure 4, a track of the parameter time interval error (TIE). Ideally, this track would be a series of small numbers, both positive and negative, that looked like a straight line with a small amount of noise on it. For the example in Figure 4, it is clear the track is not a straight line.
Using the cursors, the most basic measurement tool in an oscilloscope, you can immediately see there is some sort of disturbance moving the data edges relative to the local clock at a 300-kHz frequency. A more advanced method is to apply an FFT to the track of the TIE parameter.
The FFT reveals three separate problems, each of which is fatal to the product’s capability to meet the PCI Express standard. Two of the problems occur at low frequency while the other is pickup from an on-board 100-MHz oscillator (Figure 5).
Once the design team has identified the sources of noise impacting the serial data stream, the next step is to figure out how the noise got into the signal and how to filter or eliminate the noise. In some cases, it is useful to send commands using a low-speed serial data bus to transmit high-speed serial data packets and observe the results of the system operation.
Summary
Designing an embedded system involves use of a wide variety of signals, some of which may be on digital buses while others have arbitrarily shaped analog properties. To help engineers get the products to market before the competition, the use of serial decode, triggering, bus viewing, and signal troubleshooting tools has advanced enormously in the past few years. These tools also can be used to characterize the robustness of a design to determine the margin by which a product meets or exceeds it specifications. In some applications, it can be quite helpful if a single instrument can perform measurements of slow-speed signal buses and clocks as well as higher speed serial data streams.
About the Author
Michael Lauterbach, Ph.D., is director of product management for LeCroy. He has worked 27 years for LeCroy, starting as manager of engineering services. His doctorate from Yale University is in high energy physics. Dr. Lauterbach has published more than 75 papers on the use of digital test equipment and presented more than 300 seminars at technical conferences and for engineers at venues including IBM, Motorola, Seagate, and the U.S. State Department. LeCroy, 700 Chestnut Ridge Rd., Chestnut Ridge, NY 10977, 800-453-2769, e-mail: [email protected]
April 2009