Tips, Tools and Applications for the Electronic Industry in Europe

Posted on 2012/06/13 by George

Logic Analyzer vs. Digital Data Logger

They both increase visibility on embedded systems, but what are they good at?

In the world of general-purpose equipment used to troubleshoot embedded systems, oscilloscopes hold a central place, as 'all-around' tool for all kinds of embedded systems. Digital and mixed-signal oscilloscopes sometimes provide high-level functionalities - such as protocol decoding.

Still, from physical layer to application software, debugging (and verifying, and testing, ...) embedded system will likely require 'more than just a scope'. Byte Paradigm recently investigated the reasons why engineers use other types of general-purpose equipment. We were especially interested in the technical value of digital data logger for embedded system debugging. Figure 1 below summarizes the main findings.

These results originate from systematic informal discussions with visitors at the 2012 editions of Embedded World (Nuremberg, Germany) and Design West (San Jose, USA).

figure 1Figure 1: Overlapping areas show that tools are often used interchangeably or together.
Colored arrows show the main reasons why a user would prefer to switch from one Type of equipment to another. Some intersecting areas are labeled with frequently-mentioned tool use.

Looking for specific capabilities

This is not a surprise: specific capabilities make some tools better fitted for specific tasks. While most engineers tend to claim that their good old oscilloscope can be used for virtually 'anything electronic' - from analog troubleshooting to software debugging, doing so gets tedious if more than 4 channels are needed simultaneously.

1. From oscilloscope to logic analyzer

Increasing the number of digital channels is the main reason for using a logic analyzer or a digital data logger rather than - or together with - oscilloscopes. As 'one-and-zero scopes', logic analyzers do not provide the analog information of oscilloscope. So, getting more channels sacrifices the 'vertical resolution'. Oscilloscopes are irreplaceable if the signal's analog resolution is relevant.

It is worth noting that engineers use scopes and logic analyzers to detect 'glitches' - that is, short, spurious events occurring on digital lines. The duration of these events is below the clock rates of the embedded system but they are likely to affect the embedded system's behavior. Glitch tracking makes the most of the (generally) higher sampling frequency of oscilloscopes. Using a logic analyzer can help correlate the glitch occurrence with the functional data that that is processed in the system.

2. From logic analyzer to digital data logger

The need to increase trace memory pushes engineers to switch from logic analyzers to digital data loggers.

Basically, logic analyzers are very similar to digital oscilloscopes: they sample electrical signals and store 'raw' signal information into a memory. Whether the signals actually contain information is of no importance: logic analyzers take all the samples.

Example: visualizing traffic from microcontroller bus

Embedded software engineers often need to see what happens on a microcontroller external bus. Getting insight on such traffic helps correlate software execution with what happens on the embedded system, at the periphery of the microcontroller. A similar scenario exists for multi-core embedded systems: knowing about the data traffic exchanged between 2 microcontroller allows tracking problematic course condition
in software execution.

When a logic analyzer is used to sample a microprocessor peripheral bus, it does not matter whether there is actually data transiting on the bus - the logic analyzer samples the bus even if it is IDLE.

If the engineer is only interested in the functional data, logic analyzer may prove too limited. An important part of its memory will be used for storing unwanted information. Sometimes, special features like trigger rearming and data compression can help overcome this memory limitation.

Digital data logger are sometimes called 'bus monitor' or 'bus recorder'. As such, their mechanism is fundamentally different to this of a logic analyzer:

On one hand, a logic analyzer starts collecting digital samples upon the occurrence of a trigger condition and runs until its memory is full. Like we have shown above, most of them also have the ability to restart this sequence of operation in loop - which is called 'trigger rearm'. Between the end of a capture and the logic analyzer being ready for a new one, there is a latency that we called 'dead zone'. This latency is the time needed for the logic analyzer to re-initialize a new capture (see figure 2)

On the other hand, a digital data logger is 'always-on'. Once the user has defined the data capture conditions, the device will 'sniff' the bus until it is stopped. So digital data loggers are better suited than logic analyzers for running during hours or days. Data loggers are also better to collect a lot of data (up to Gigabytes). This is a tremendous advantage over logic analyzers for understanding the history of events that has lead to a functional bug (see figure 3).

figure 2Figure 2: A logic analyzer is used to sample a digital bus. When the wave line is 'flat', the bus is idle. The digital traffic is represented by the colored areas. When the logic analyzer's maximum storage capacity is reached (green), it stops sampling the bus. Before re-starting, there is a 'dead zone', needed for the logic analyzer to re-arm trigger.
figure 3Figure 3: In addition to providing bigger storage capacity, a digital data logger is able to filter
data. This helps save on the available memory and get a better 'functional visibility' of the embedded system from a 'data' perspective.
 

3. What about the software debugger?

The term 'software debugger' really covers software emulation - that is, debugging embedded software directly on the target embedded microcontroller using its special debug port and resources.

Many embedded software engineers are just happy with debugging their code using this technique. Microcontroller are at the center of embedded systems. With adequate test software, a microcontroller allows testing (and debugging) the full system quite efficiently.

However, viewing data that transits on the peripheral interfaces and busses of a microcontroller is extremely valuable. Software debuggers alone do not provide such insight.

Like we already mentioned, two cases were frequently mentioned among the gathered testimonials:
- Multi-core embedded systems. Getting insight traffic exchanged between processors is crucial to multicore software debug.
- Embedded systems with 'decentralized data processing' - for instance, an embedded system where a co-processor (like a FPGA) does most of the processing job.

In those cases, using a digital data logger together with software emulator enhances the engineer's productivity.

Conclusions

figure 4Figure 4: General-purpose tools and their respective roles in embedded system debug, from low-level hardware to high-level application software.

Debugging embedded systems is a complex task that involves many techniques, from hardware simulation and software emulation to using tools on a real hardware. In the world of general-purpose tools for debugging embedded systems, oscilloscope, logic analyzer, digital data logger and software debugger fill a space from low-level, physical hardware debugging to high-level function software debugging.

In particular, the digital data logger is the ideal companion of the software debugger. With its data filtering capabilities and large memory resources, it allows seeing the low-level 'effects' of software execution at the periphery of embedded microcontroller. Being 'data-oriented', it enhances the visibility over embedded system during (software) debug.

Read more and get your Data Logger now!

 

Original document was written by Frédéric Leens at Byte Paradigm.

This entry was posted in Test & Measurement, Development

by George