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.

This Arduino sketch implements a SUMP protocol compatible with the standardSUMP client as well as the alternative client from here: http://www.lxtreme.nl/ols/

This SUMP protocol compatible logic analyzer for the Arduino board supports5 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 thecrystal oscillator pins.Uncomment CHAN5 below if you want to use the LED pin as an input and have6 channels.

NOTE:You must DISABLE the Arduino auto reset feature to use this logic analyzercode. 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 really120 Ohm or you may damage your board.

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

Triggering is still a work in progress, but generally works for samplesbelow 1MHz. 1MHz works for a basic busy wait trigger that doesn't storeuntil 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.

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.

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.

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

ThanksChris

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?