Go Down

Topic: SUMP compatible logic analyzer code for Arduino. (Read 124856 times) previous topic - next topic


I recently implemented a logic analyzer compatible with the SUMP protocol.  It was designed for a 16MHz Arduino with the ATmega328p.  It might work fine on the ATmega168 but I haven't tested it.  I'm using a Duemilanove.  You will have to disable auto reset to make this work.  See this topic:  http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

The loops that do the sampling have been hand tuned to fairly precise timing using an Open Bench Logic Sniffer to measure the cycles.  You absolutely need a 16MHz clock for accurate data.  I haven't looked at making a version for other clock speeds but you can file a request at GitHub.

I'm very interested to hear from you if you try it on your hardware and find it useful or have trouble.  I have done limited testing of multiple channels as well as basic triggering.  If something doesn't work I would appreciate some feedback.

Get the code here: http://github.com/gillham/logic_analyzer

Here's my initial README:

SUMP compatible logic analyzer for Arduino

This Arduino sketch implements a SUMP protocol compatible with the standard
SUMP client as well as the alternative client from here:

This SUMP protocol compatible logic analyzer for the Arduino board supports
5 channels consisting of digital pins 8-12, which are the first 5 bits (0-4)
of PORTB. Arduino pin 13 / bit 5 is the Arduino LED, bits 6 & 7 are the
crystal oscillator pins.
Uncomment CHAN5 below if you want to use the LED pin as an input and have
6 channels.

You must DISABLE the Arduino auto reset feature to use this logic analyzer
code. There are various methods to do this, some boards have a jumper,
others require you to cut a trace.  You may also install a *precisely*
120 Ohm resistor between the reset & 5V piins.  Make sure it is really
120 Ohm or you may damage your board.

To use this with the original or alternative SUMP clients,
use these settings:

Sampling rate: 1MHz (or lower)
Channel Groups: 0 (zero) only
Recording Size: 512 (or lower)
Noise Filter: doesn't matter
RLE: disabled (unchecked)

Triggering is still a work in progress, but generally works for samples
below 1MHz.  1MHz works for a basic busy wait trigger that doesn't store
until after the trigger fires.
Please try it out and report back.


I updated this code today.  It now fully supports recording 1024 samples.  I had accidentally defined the samples as integers and overlooked this fact until this weekend.  The timing / padding was redone now that the loops are doing single byte assignments and compared against the OBLS again.

Note that I recently bought a "Seeeduino V2.21 (Atmega 328P)" which has a switch to disable auto-reset.  It works really well with this code.  Now that I have tried both, I definitely prefer an auto-reset disable switch or jumper over the 120 ohm resistor method.


I was looking forward this for a while. Finally, we have Arduino based logic analyzer with proper GUI!
I appreciate your effort and will try soon.


Let me know how it works for you.  I still need to work on triggering, but the basic logic analyzer functionality is there.

Also, I have been working on a device profile with the help of the author (Jawi) of the alternative SUMP client.  Once the profile is correct and Jawi adds it, the next release of his client should have better support.  The most significant feature is it  will no longer require disabling auto-reset as he added the ability to delay a bit until the device is ready after the serial port is opened.  If you want to use the original SUMP client you'll need to disable auto-reset, but really Jawi's client is the way to go.


Tried and works great. It was a bit hard to catch sparse I2C signal without triggering but it works.
I was planing to buy the bus pirate as a logic analyzer, now I don't need it.  :)

Looking forward to see trigger and proper device profile.
I don't even bother to try original SUMP, since alternative one look better.


Thank you for testing this code and reporting back.

I think I have a fix for basic triggering, I need to test it further and re-measure the timing before I commit it.


I believe I've made basic parallel triggers work as they should and updated github.  Can you try the latest code with some triggers and report back?


Sorry, I forgot to subscribe the thread. I will test and report. Thanks again. :)


Has anyone else had issues with this,  I compiled it put it on the arduino and then disabled the auto reset.   I tried the settings listed but always get " device can not be found".  The tx/rx lights blink when I try to connect so something is happening at least.  Just not sure what to test from this point.


Use the Arduino IDE's Serial Monitor tool, at 115200 bps, to send '1' or '2' and you should get something back from the logic analyzer code if it is running.  If you get the debug output, then I would say it is a problem with auto-reset not being fully disabled that prevents the SUMP client from working.

If you can, use a build from github of the newer alternative client that supports device profiles.  ( https://github.com/jawi/ols ) You'll have to check it out with git and build it yourself with maven.  Put the attached file in <git clone location>/ols.distribution/src/main/config for the 'master' branch.

The github built alternative client won't require you to disable auto-reset and it will default to values that work with the AGLA.  If you can't build it I could make a known working image available.  It is just over 3MB.

Let me know how it goes.


I'm looking to try this code but wanted to know which, if any, pin is used for ground, or doesn't this matter, this seems to be necessary with the original Open Bench Logic Sniffer.  I intend to load the sketch to my Arduino, leaving it connected to my PC for power, connect the probe pin(s) to those that I want to monitor and run OLS.  Has the device profile been added to the latest version of OLS, I downloaded it last night but couldn't see a specific device for the Arduino.

Thanks for any help.


Use the ground pin on the Arduino and it should work fine.  That's how I've been testing it.

The device profile hasn't been added yet, you can use the one attached to my previous post.  If enough people are using it, eventually we can get it added to distribution.

If you have any trouble getting it working, let me know.


Jul 31, 2011, 12:31 pm Last Edit: Jul 31, 2011, 12:36 pm by caroper Reason: 1
Hi gillham,

Thanks for posting this, it looks like it is exactly what I was looking for to demonstrate simple Sequential logic, on a breadboard, without having to use a professional logic analyser. However I cant seem to get it to work :)

I Downloaded ols-0.9.4 and placed the ols.profile-agla.cfg into the plugins directory.
I have \gillham-logic_analyzer-ff10c1e compiled and loaded on a MEGA256 and it responds to the debug commands 1 and 2.
When I capture I can select the Device and the Port, the LEDs on the Arduino flash but OLS returns Capture Aborted! Device not found!.
I have not disabled auto-reset, as this is not my board so I don't want to cut the trace :)
Do I need the special build of OLS you mentioned?
if so would you be willing to provide it as I don't have the capability to Build from source.


p.s. I didn't use the make file you provided with the pde file as I was not sure how to, have I compiled incorrectly by not using it?


Hi Chris,

I just did all this on Friday, I've compiled the latest OLS with the AGLA profile, here's a link if you want it :- http://www.mediafire.com/?84nfcq31to7p1bk



Thanks Karl,

You are a star, downloaded and installed ok, but is still get the Capture Aborted! Device not found!
I will have to fish around for a 110ohm resistor and see if that works.


Go Up