SUMP compatible logic analyzer code for Arduino.

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. :slight_smile:

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. :slight_smile:

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. ( GitHub - jawi/ols: OpenBench LogicSniffer repository ) You'll have to check it out with git and build it yourself with maven. Put the attached file in /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.

ols.profile-agla.cfg (2.17 KB)

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.

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 :slight_smile:

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 :slight_smile:
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.

Thanks
Chris

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

Karl

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.

Cheers
Chris

Well I Created a header with a 100 and 10 ohm in series to bridge 5v to reset, but it appears that the Mega is still resetting.
any other Ideas?

GOT IT :slight_smile:

Edit the plugins\ols.profile-agla.cfg File
line42: device.open.portdelay = 1000

The default was 500ms Delay increasing to 1second (1000ms) works fine without the 110ohm resister.

I was going to post this morning to let you know about that setting, but you found it on your own. Good job! Glad to hear that helps on your Mega.

I have not tried my code on a Mega and the timing is hand tuned to the 16Mhz ATMega328 on the regular Arduino boards. I don't have a Mega to test it, but since it is running at the same clock rate it might be fairly close already.

Let me know how it goes for you and if you have something you can test with to see how accurate the timing is that would be useful. If you have another Arduino with a 16MHz crystal and ATMega328, I could get you a small signal generator sketch that you could use to measure with your Mega running AGLA.

If there is enough interest from other Mega users I can pick one up and test it out. Basically I just use some debugging to toggle an extra pin inside the capture routines and time those toggles with my Open Bench Logic Sniffer. It is accurate up to 100MHz so I can easily measure the Arduino pins. I highly recommend the Open Bench Logic Sniffer for anyone getting further into things than my AGLA can provide. Of course I think the AGLA is pretty nice for "free" on your existing Arduino, but obviously has some inherent limits.

Edit: Forgot to address your question about the Makefile. You did the right thing using the Arduino IDE and ignoring the Makefile. That is only for command line use if you want to skip the Arduino IDE. Especially useful with the 'arduino-core' package under Debian. I have compiled on my ARM based Sheeva plug computer for the Arduino using the Makefile so it can be handy.

Thanks gillham,

For the application on hand accurate timing was not needed, I just wanted to demonstrate the relative timing on a simple sequential logic experiment, but your code has captured my imagination and I would like to take it further. I switched it to using PORTC and adjusted the profile to an 8Bit sample. I saw your timing code, It occurred to me that it could be used as an external clock to run the circuit under test, but I haven't tried that yet. I would be interested to see your signal generator sketch, but unfortunately I only have the 2 Arduino Mega boards on hand.

I have a pic32 explorer and, hopefully, some chipKit MAX32's arriving this week so once the project that they were ordered for is completed, I may dedicate one to this application.

What I have in mind is an interface to a breadboard system, such as this RadioShack.com Official Site - America's Technology Store.
A dual channel scope, 8 channel logic analyser, a frequency counter and a simple multimeter application running on a cheap board, possibly enclosed in the Learning Labs case, would make a great learning tool for kids of all ages. Bandwidth in the audio range for the scope and up to one Mhz for the digital portions would probably be within the capability of a high end chip.

Cheers,
Chris

I ordered an Arduino Mega 2560 from SFE, should be here later this week. I'll work on adding better support and get the timing tuned as needed.

I like your idea of combining oscilloscope ("The cheapest dual trace scope in the galaxy" style), logic analyzer, function generator etc into a workbench toolkit that is ready to go. It could be done just by adding a couple extra commands (similar to the debug options) or extend SUMP slightly

My current function generator code is rather simplistic and is set for my 8MHz Arduino Pro Mini. I use 1 button and 1 LED for the UI and it works ok. Timing is fairly accurate according to my OLS hardware, since it is using a hardware timer, but running on a 16MHz Arduino the values will be off by a factor of 2.

Anyway, I'll attach my simple function generator for anyone interested. Make sure you use current limiting resistors as appropriate so you don't damage anything. If you connect your target board, logic analyzer, signal generator etc, it is too easy to have pins in the wrong mode, (both output, one high, one low etc) and over current the pins on one or both devices. 1k Ohm for example on the appropriate pins will limit 5V to 5mA.

Rugged Circuits has a great page about what not to do. ( 10 Ways to Destroy an Arduino — Rugged CircuitsRugged Industrial Arduino Microcontrollers )

function_generator.pde (6.66 KB)

Thanks gillham, I'll give it a try.

Any Idea where I can get documentation on the SUMP protocol so I can try and integrate the analog read into the data?

Cheers
Chris

There original SUMP protocol is here: sump.org: Communications Protocol
The extended version is here: The Logic Sniffer's extended SUMP protocol - DP

It seems like a couple 8bit "short commands" could be added as long as they don't overlap with anything listed in the above links.
My initial thought would be something like below. These couldn't all be 8 bit short commands though as things like the function generator at least need parameters like what frequency or function. I was just picking simple mnemonics so you could connect serially and press 'A' for example. Might need a 'T' command to say "send values in text not binary" when doing that I guess.

#define SUMP_MULTIMETER_AMP_DC	0x41	// ASCII 'A' for Ampere
#define SUMP_MULTIMETER_AMP_AC	0x42	// ASCII 'B' (can't think of a mnemonic)
#define SUMP_FREQUENCY_COUNTER	0x43	// ASCII 'C' for Counter
#define SUMP_MULTIMETER_FARAD	0x46	// ASCII 'F' for Farad
#define SUMP_FUNCTION_GENERATOR	0x47	// ASCII 'G' for Generator
#define SUMP_MULTIMETER_HENRY	0x48	// ASCII 'H' for Henry
#define SUMP_MULTIMETER		0x4E	// ASCII 'M' for Meter
#define SUMP_MULTIMETER_OHM	0x4F	// ASCII 'O' for Ohm
#define SUMP_MULTIMETER_VOLT_AC	0x52	// ASCII 'R' for RMS maybe?
#define SUMP_OSCILLOSCOPE	0x53	// ASCII 'S' for Scope
#define SUMP_MULTIMETER_VOLT_DC	0x56	// ASCII 'V' for Volt
#define SUMP_MULTIMETER_WATT	0x57	// ASCII 'W' for Watt

It wouldn't really make sense for a SUMP logic analyzer client to use these extended commands, but adding them to my existing logic analyzer code would make it easy to have a device that responds to SUMP for the OLS client and does the extra functions as well.

I guess short commands are impractical since many of the functions need a 'type' (what to measure, or what kind of function to generate) followed by a 'range' or 'value' (what frequency to generate). So perhaps the 1st byte commands could be:

#define SUMP_FREQUENCY_COUNTER	0x43 // ASCII 'C' for Counter
#define SUMP_FUNCTION_GENERATOR	0x46 // ASCII 'F' for Function
#define SUMP_MULTIMETER		0x4E // ASCII 'M' for Meter
#define SUMP_OSCILLOSCOPE	0x4F // ASCII 'O' for Oscilloscope

After that the 4 byte parameters can be whatever is needed for the appropriate functions.

I've added initial Mega 2560 support to the logic analyzer. Please check it out here:

The Mega 2560 supports allows 8 channels (using PORTA, pins 22-29, but you can configure it) and 7K samples. I have done some basic timing tests and it is fairly accurate. I will tune it with my Open Bench Logic Sniffer soon, but it seems very usable already.

Please test it and let me know how it works for you. I've added the two device profiles to the repository so they're easy to find.