ATM18 Logic Analyzer: For Deft Data Acquisition
ATM18 Logic Analyzer: For Deft Data Acquisition
The oscilloscope is a fine tool for showing the evolution of a signal in time, but when it comes to digital
signals it soon shows its limitations. Few oscilloscopes can clearly show more than four signals at once, and
setting up complex trigger conditions can be messy. If it is logic levels rather than pulse shapes that matter, a
software-based logic analyzer like the one described here can offer a very powerful alternative solution.
A logic analyzer is an instrument for moni- inputs: even the simplest units have six- and forwards through a series of events: a
toring how signals in a digital circuit change teen inputs and top-end models aimed at kind of time machine for digital signals.
with time. This can of course also be done analyzing complex digital circuits have up to Unfortunately, as you might expect, these
using an analog or a digital oscilloscope, 512 inputs. The y-axis of the analyzer’s dis- instruments are not cheap.
but these devices tend to be limited in the play is only capable of displaying logic lev-
number of channels that they can simulta- els, ‘0’, ‘1’, or ‘undefined’. There is no provi-
neously process and display, and it can be sion for direct measurement of the voltage Analysis using an oscilloscope
difficult to set up the wanted triggering con- on an input as on an oscilloscope. However, Suppose you want to examine the signals
ditions. However, they are useful for mea- the unit can store a very complex series of on a serial port, a job which is actually more
suring certain properties of signals, such as events for each of its digital inputs. With the complicated than it first appears. An ordi-
pulse width, rise and fall times and signal right add-on module, a good analyzer can nary analog oscilloscope will clearly show
period. Glitches, however, can generally follow the execution of a computer program you the signal levels and the duration of
only be observed if they happen to occur in real time, disassembling and displaying each bit, but the data actually being sent are
at the right time and have sufficiently long instructions as it goes, by simply connect- still shrouded in mystery: what is being sent
duration. ing it to the address and data buses of the in the reverse direction, and what is hap-
microprocessor under test. pening on the handshake and other control
The earliest logic analyzers appeared on the lines? What should we use as a trigger sig-
market in the 1970s, and rapidly became Even though many modern microcontrollers nal? As soon as a signal has been detected,
valuable tools for engineers working in the feature diagnostic interfaces and built-in it disappears again. Although analysis
then rapidly-growing field of digital elec- hardware support for software debugging, using an oscilloscope may be practical at
tronics. These early examples featured a the logic analyzer is still a valuable trouble- 300 baud, at higher speeds it becomes very
maximum of eight input channels and were shooting weapon in the engineer’s arsenal difficult indeed.
relatively hard to use. of test equipment, allowing a rapid overview A storage oscilloscope is a better proposi-
In comparison to oscilloscopes, modern of what is happening on all input channels tion in these circumstances, since it allows
logic analyzers have considerably more and the ability to scroll rapidly backwards you to examine a portion of a signal at your
48 01-2010 elektor
test & measurement
elektor 01-2010 49
test & measurement
Listing 3 End If
If Timestamp > 60000 Then
Use of timestamps (BASCOM program Logic2.bas)
Do
Sub Logger Ram(adr) = D
Timer1 = 0 Adr = Adr + 1
Adr = 1 A = High(timestamp)
Dold = 255 Ram(adr) = A
Do Adr = Adr + 1
Timestamp = Timer1 A = Timestamp
D = Pinc Ram(adr) = A
Portb.0 = 1 Adr = Adr + 1
If D <> Dold Then
Ram(adr) = D Loop Until Adr > 500
Adr = Adr + 1 End If
A = High(timestamp) Portb.0 = 0
Ram(adr) = A Loop Until Adr > 500
Adr = Adr + 1 For Adr = 1 To 501
A = Timestamp D = Ram(adr)
Ram(adr) = A Put #1 , D
Adr = Adr + 1 Next Adr
Dold = D End Sub
50 01-2010 elektor
test & measurement
elektor 01-2010 51