SUMP compatible logic analyzer code for Arduino.

There original SUMP protocol is here: http://www.sump.org/projects/analyzer/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: https://github.com/gillham/logic_analyzer

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.

Thanks gillham,

Looks good, I just did a quick sample with no inputs connected and channel 0 read High and the rest Low, I guess that pin has an internal pull-up assigned. Thanks for confirming the timing and increasing the sample size.

I found this and thought you my be interested: http://www.easyvitools.com/rdesign/index.html

It is a bit too slow for our needs and looks old ( Help about says 2003 ) but is a great concept, if all you need is low speed switching and sampling. I am going to use it to do a Proof of Concept for the Bread-boarding tool interface. but I may have to write the target code myself to get the sort of performance I will need.

Is anyone out there aware of any other Control Panel / Virtual instrument tools that work with serial I/O ? I have not managed to find anything customisable between this program on the low end and lab-view on the high end of the scale. They all seam to be designed to work with SPICE with no physical Real World interface or they are designed to work with dedicated hardware.

I did find a device that does provide all the functianality, but at a much higher speed and accuracy than I had in mind, with a corospondingly higher price tag too :) but I will include it here as It is a good target to aim for.

http://www.tina.com/English/tina/real_time_t_m

Cheers Chris

Thanks Ghillam !

I imagine your code with some SDRAM !!! http://dangerousprototypes.com/docs/Logic_Shrimp_design_overview or here : http://www.ikalogic.com/scanalogic2/build.php

Regarding virtual instruments, I'm not familiar with many. I've seen the cheap 'scope and another "miniscope" ( http://tomeko.net/miniscope_v2b/index.php?lang=en ) project.

I was kind of assuming something written in Processing would be best. That way it is cross platform and could be used in conjunction with Firmata for example.

The thing with the oscilloscope is that the sample rate would be really low. It would be better than nothing, and I'm not saying it isn't worth doing, but you won't get that many samples across the serial port. Something like 11k 8 bit samples/second @115200 baud would be best case.

About the logic shrimp.. I prefer the Open Bench Logic Sniffer. Only a few dollars more and more capable. The whole point of my code for the Arduino is "cheap & dirty" without paying $35-$50 and just using what you have. I wouldn't expect anyone to buy a Mega to run my logic analyzer code, the OLS is cheaper. :)

I guys I am new to arduino. I work on LCD , TV, SMPS, etc. Sometimes I have to look up an IC data sheet and see what kind of wave it should put out on a certian pin so I can confirm the suspect IC is working.

Is there a way with this logic analyzser that I can use the arduino to test an IC just to confirm it works properly.

I test the PWM IC on SMPS and , sometimes the MCU on the main board.

Thanks for your input.

Something not mentioned - The direction to read it is from right to left? I tested grounding pin 8 and that seems to suggest the LAST state change is at the beginning.

grant1842: I guys I am new to arduino. I work on LCD , TV, SMPS, etc. Sometimes I have to look up an IC data sheet and see what kind of wave it should put out on a certian pin so I can confirm the suspect IC is working.

Is there a way with this logic analyzser that I can use the arduino to test an IC just to confirm it works properly.

You should be able to use a logic analyzer if the specs in the data sheet match the capabilities of an AGLA setup. With limited numbers of samples and a limited sample rate it depends on the type of chip and what its digital signal is supposed to look like. If the IC's pin transitions are in the 10s of microseconds you should be able to catch something. You might want to read this page about all of the ways you can hook stuff up wrong and damage the pins on your Arduino: http://ruggedcircuits.com/html/ancp01.html

You might want to investigate the Bus Pirate ( http://dangerousprototypes.com/docs/Bus_Pirate ) as well since it is designed for interfacing to chips like you mentioned.

al1fch: I imagine your code with some SDRAM !!!

I created a test branch ("logic_analyzer_megaram" branch on https://github.com/gillham/logic_analyzer/ ) with preliminary support for external SRAM on the Arduino Mega2560. I am using the Rugged Circuits QuadRAM board ( http://ruggedcircuits.com/html/quadram.html ) myself.

The QuadRAM is paged, but without using any paging it adds a readily addressable 55KB of space for a capture buffer. My test branch supports capturing up to 55KB if you have the '#define MEGARAM 1' uncommented.

Due to some extra cycles on the external memory interface the sampling takes a bit longer and I had to adjust the timing a little. Currently a regular (non triggered) capture at 1MHz is no longer accurate due to the increased delays with the external SRAM, but 500KHz and lower appears to be fairly accurate. Triggered captures are not accurate at 500KHz (they weren't at 1MHz already) but are semi-accurate at 200KHz and lower.

Anyway, if someone has an external SRAM setup and can test this functionality I would appreciate feedback. Rugged Circuits has the board on sale for $19.95 which isn't bad for a 512KB expansion module. I'm not affiliated with them, I've just bought one of their boards.

Also, as the external memory interface uses the pins I had previously sampled on the Mega, I switched to analog pins 0 to 7. I was avoiding using the analog pins previously so they would be available for other uses, but as I haven't added any other features to the firmware at this point, I switched pins. The main branch has not been switched to A0-A7, but I might do that in the future.

You can either download the files from the branch via the web interface, or using the git command line. Here's how to use the commandline.

Initial checkout (of master branch) and switching to logic_analyzer_megaram branch. $ git clone https://github.com/gillham/logic_analyzer.git $ cd logic_analyzer $ git checkout logic_analyzer_megaram

Switching back to the master branch is easy. $ git checkout master

Thank you gillham for your great code.

I was about to describe some difficulties i was having but they all got solved while I was typing) so thanks again. But could you please share your signal generator sketch along with some instructions on how to use it. I have your code on Mega 2560 and would like to test it with another Uno I have. Thank you and a Happy New coming Year to all!

I have been messing around with some IR decoding and thought I would give this a shot and had a few problems.

Has anyone updated the Sketch since Arduino 1.0 came out?

I get a compile error that "As of Arduino 1.0, the 'BYTE' keyword is no longer supported. Please use Serial.write() instead.

I started to make the modification and got stuck in a few places that had "Serial.write(0x00, BYTE );" Changing to Serial.write(0x00); produces a new error. I figured I would ask before I spent too much time.

Thanks,

Try here: https://github.com/gillham/logic_analyzer/branches

@tocpcs: Thanks for the link.

I was able to get the latest sketch (logic_analyzer.ino) to compile after commenting out #define MEGARAM 1. I copied the .cfg files and made sure they were modified for the 1000ms delay as noted in an earlier post, still getting "device not found". I get a response from the Arduino via serial when the sketch is running by pressing 0 or 1.

Arduino Duemilanove W/Atmega 328 Macbook Pro W/OS X 10.7.2 Logic Analyzer Client 0.9.4 Logic Analyzer Sketch Release: v0.06 November 4, 2011. Arduino 1.0

I had some similar growing pains with the Bus Pirate, but eventually got it going. Any suggestions would be great.

-John

UPDATE Increased the delay to 1500ms and it seems to be working

The master branch (what shows up on the front page of http://github.com/gillham/logic_analyzer ) should work fine on 1.0 and doesn't have the Mega external SRAM support. Make sure the branch drop down says "master" and you should have the right one.

I'm working on a version for the Mega with 512kb of external SRAM (via a "QuadRAM" board). The current branch doesn't bank switch and supports 55kb. My bank switch version is in development but will support at least 443kb of samples at 500KHz.

Anyway, let me know if you have any more trouble and try the master branch if you can.

Hi all

This looks like a great project. Just what I'm looking for.

I currently have a Mega1280 clone. Any reason this should not work?

If not I'll give it a try. Whats the best client to use. I'm on Vista. Thanks for any pointers offered.

Carry on the great work.

Rob

Hi guys

I've read the thread from the beginning and I'd like to use this tool. Unfortunately I am a bit lost with some steps as I am a Windows moron :D

I managed to install Git for Windows (yeah! ;)) and grab both Gilham and Jawi tree. I can find the Arduino sketch in Gilliam but not sure what I have to do with hundreds of files for OLS. I understood it needs to be compiled ! Java ? Compiled ?

I also tried to get the pre-built binary from BoxOrange opst on page 1 but the file has moved away from MediaFire

So if someone could summarize me what I need to do to get OLS ready to run, or provide me a pre-built one, that would be nice.

Thanks in advance.

is this project still maintianed? i really would like some help to get my leonardo working with this. thanks in advance. sry for posting in this old thread but couldn't find any other info about it.

edit

nvm figured it out myself it's missing a line of code

[Arduino compatible config file]

# Configuration for Arduino Generic Logic Analyzer profile

# The short (single word) type of the device described in this profile
device.type = AGLA
# A longer description of the device
device.description = Arduino Generic Logic Analyzer
# The device interface, SERIAL only
device.interface = SERIAL
# The device's native clockspeed, in Hertz.
device.clockspeed = 16000000
# Whether or not double-data-rate is supported by the device (also known as the "demux"-mode).
device.supports_ddr = false
# Supported sample rates in Hertz, separated by comma's
device.samplerates = 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000
# What capture clocks are supported
device.captureclock = INTERNAL
# The supported capture sizes, in bytes
device.capturesizes = 64, 128, 256, 512, 1024
# Whether or not the noise filter is supported
device.feature.noisefilter = false
# Whether or not Run-Length encoding is supported
device.feature.rle = false
# Whether or not a testing mode is supported
device.feature.testmode = false
# Whether or not triggers are supported
device.feature.triggers = true
# The number of trigger stages
device.trigger.stages = 1
# Whether or not "complex" triggers are supported
device.trigger.complex = false

# The total number of channels usable for capturing
device.channel.count = 5
# The number of channels groups, together with the channel count determines the channels per group
device.channel.groups = 1
# Whether the capture size is limited by the enabled channel groups
device.capturesize.bound = false
# Which numbering does the device support
device.channel.numberingschemes = DEFAULT

# Is a delay after opening the port and device detection needed? (0 = no delay, >0 = delay in milliseconds)
device.open.portdelay = 1500
device.receive.timeout = 1000 // this is the Missing line
# Does the device need a high or low DTR-line to operate correctly? (high = true, low = false)
device.open.portdtr = true
# Which metadata keys correspond to this device profile? Value is a comma-separated list of (double quoted) names...
device.metadata.keys = "AGLAv0"

# In which order are samples sent back from the device? false = last sample first, true = first sample first
device.samples.reverseOrder = true

###EOF###

Hi,

I followed the instructions and set up both an Arduino Duemilanove and a Mega. They both appear at Devices and when I click on the Metadata-button, I can see OLS recognises the board. Yet, when I hit Capture begin, I cannot see anything happening. I tried logic signals of different speed and kind and cannot see any waveform on the channels. What am I doing wrong?