Menu

Home

Logical Analyzer

An Arduino based open source project for logical signal analyzing.

The tool supports listening on 4 input pins and enables changing the state of 4 output pins. Supports internal pull-up resistors as well for the floating pins. The minimal change interval is 2us (faster changes can't be detected). The PC <=> Arduino RS-232 connection can be configured between 9600 or 2000000 baud (the highest baud rates work only with Arduino UNO).

As RS-232 connection can be slower than collecting the samples, the tool stores the samples first in an internal memory (256 samples), and transmits them as soon as possible. Too frequent changes results buffer overflow error, so this tool is mainly for transient analysis.

Using Arduino UNO is recommended because of the fast RS-232 speed.
The captured results can be stored in CSV files.

Captured TWI sample:
LogicalAnalyzer

Installation

Prerequisites:

  • installed java
  • or installed Arduino framework (containing java)
  • installed Arduino drivers (FTDI or UNO, the operating system sees Arduino as a COM port)

Supported systems:

  • Windows XP
  • Windows 7
  • Linux

The latest version of Logical Analyzer can be downloaded from here

On Windows if java is not in your path, then either add it, or modify the bat file to be able to start java.

@echo off
REM set the Arduino's java path here
SET PATH=../arduino-1.0.1/java/bin;%PATH%

Pinout

LogicalAnalyzer

  • GND: the first thing to do before starting measuring is to connect the GND-s
  • Input pins: the logical signals to be measured
  • Output pins: can be used for triggering certain events
  • Always 1 pin: can be used for getting +5V (30mA). Using an AVR pin instead of USB's +5V is safer, as if there's a short cirtcuit, then Atmega328P will go wrong instead of the PC's motherboard.

Getting started

Configuring the software

  • Connect the Arduino card to the computer
  • After the first run the settings dialog will be shown

Settings

  • Select the Arduino device
    (it's can be /dev/ttyACM0 /dev/ttyS0,... on Linux, COM1, COM2,... on Windows)
  • Press the 'Autodetect' button
  • If auto-reset is not enabled on the card, the dialog will pop-up messages to press the reset button (this will be asked several times while the right bootloader baud rate is figured out).

    The usage of this dialog is easy: press the reset button on the card as soon as the dialog appears and release it when 0 is reached. Take care of releasing reset precisely, otherwise the code will not be able to start communication with the bootloader.

ManualReset

  • When the procedure ends, the right settings will be chosen on the dialog and the unusable options will be greyed out.
  • Press the 'Apply' button to finalize the changes

Creating a prototype panel on breadboard (prell measurement)

Create a simple panel, containing a switch:
Prototype

Starting the measurement

  • Press 'Connect' and wait for the communication to start
  • Enable the pull-up resitors (required for a switch)
    PullUps
  • Press 'Start' button (this will start the measurement)
  • Press the switch once
  • If there was no prell, then the change counter will increase by 2.
  • If a prell is catched, the change counter will increase by more than 2
  • Repeat the procedure as long as a prell is captured
  • Press 'Stop'

Watching the results

  • After pressing 'Stop', the results will appear on the screen:
    Results
  • Zoom in to the results by
  • pressing '+' (zoom in)
  • pressing '-' (zoom out)
  • or pressing '<->' (fit)
  • or use the mouse wheel for zooming

Saving the results into CSV

  • Results can be saved to CSV format which is also handled by MS Excel
  • Press the 'Save' button:
    Save
  • The result file will contain the input/output pin changes with the timestamps

Technical Details

  • Arduino runs on 16 MHz, the internal clock uses the 1/8 prescaler, so the time precision is 0.5 us.
  • The changes are collected by PIN change interrupt which requires 29 cycles for the CPU. This limits the minimal change duration to 2 us (faster changes can't be detected).
  • The changes are sent to the PC through RS-232. The length of a change is either 2,3 or 4 bytes, depending on the elapsed time from the previous change. Frequent changes are sent in 2 bytes.
  • The internal buffer can store 256 changes, which is relatively small. If the RS-232 communication is slow, then the buffer can easily overflow. One can roughly estimate the maximal frequency based on the baud rate: baud_rate / 10 (bits) / 2 (bytes) samples per second. On Arduino UNO and 500000 baud it's 25 kHz.
  • Currenly rates over the 500000 baud have minimal impact on the speed, as logical analyzer is currently unable to produce data so fast. 1000000 baud results a little bit faster transfer than 500000 baud, but the difference is minimal. 2000000 baud has no benefit over 1000000 baud at all.
  • Logical Analyzer can run on different baud rates and connecting to the device is not easy as the software has to figure out the current rate. This happens by sending a 0x55 byte on 600 baud. This will result framing errors with 0x00 bytes and 300Hz period. If AVR receives similar framing errors, then automatically sets its baud rate back to 9600 baud. After that communication with the device will be possible.

Screenshots

Screenshot thumbnail
TWI result
Screenshot thumbnail
Starting screen
Screenshot thumbnail
Hungarian translation
Screenshot thumbnail
Settings

Project Admins:


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.