SUMP compatible logic analyzer code for Arduino.

Hey appreciate the thanks, glad you're able to get some use out of my project.
I have a number of variations of the Arduino now for testing and with the code updates to the OLS client to include my config files I need to cleanup my project a little so there is less confusion about what is needed. Hopefully that will happen before too long so people picking up my project for the first time aren't confused by somewhat outdated information.

Anyway, regarding using a DUE or getting a real logic analyzer, I strongly recommend the Open Workbench Logic Sniffer (OLS) for $50 from Seeedstudio for more serious work. The $10 logic analyzer's on eBay tend to be Cypress EZ-USB FX2LP development boards that clone the Saleae Logic firmware or similar. Then people seem to (illegally) use the Seleae Logic software with these clone boards. Sadly you end up with a proprietary logic analyzer and software that is essentially pirated. Not what you really want IMHO. $50 for the OLS is a great way to go. The authentic, licensed Saleae Logic package for $149 sounds good based on what I've read about it, but certainly isn't open source or open hardware.

The Logic Analyzers on eBay seem to be based on Cypress EZ-USB FX2LP boards. These have an 8051 compatible core and decent speed. In theory it would be possible to create SUMP compatible firmware to replace the cloned firmware being used. Then the OLS alternative client could be used with it as well. I might investigate doing that at some point in the future, but no promises. I think the ATMega328p based code is good enough and really a hardware board like the OLS should be the next logical step.

More likely future work would be incorporating Leonardo changes back into my code versus trying to get a completely different platform working.

Note that the Arduino USB Nano boards on eBay for around $7 should work with my code and can easily be dedicated as a logic analyzer at that price. It is hard to beat $7 for basic functionality. I should be getting one in a week or so and will verify it works well.

As I mentioned earlier in this thread I did a proof of concept of an ethernet based AGLA since the OLS client supports talking to a logic analyzer over tcp/ip. I haven't messed with that code recently, but it was working with a WizNet W5100 based board. I didn't see much demand for a such a thing, but are a few corner cases it could be useful. For example helping to debug some sensors or similar in their production location outside or in the shop etc where you can't sit and watch it with your laptop due to environmental concerns like it is cold / hot / up high / uncomfortable conditions etc. Then sitting at your desk and using the AGLA over the network would be nice. Due to the ethernet needing the SPI the port used by capture routines needs to be adjusted and tweaked, which I might get to at some point.

Anyway, I will try to cleanup the documentation / code to reflect modern OLS clients and ATMega328 based Arduinos. (And hopefully add ATMega32U4 like Leonardo) If you have any feature requests that are reasonable or just general suggestions let me know. Note that the code is doing most of the what it can with the limited hardware already.
Things that aren't really practical or limit the specs too much:
-- Advanced triggers, unless very low sample rate is used. (get a nice FPGA based OLS)
-- Bit stuffing samples for one channel to get 8192 samples. Again, needs a really low sample rate due to the amount of manipulation needed. End result is fairly unusable due to low speed. The Mega is a better solution if you have one, or the OLS (24KB of samples) or the Logic Shrimp (also available at Seeedstudio) which has 4 channels and 256K samples per channel.
-- More channels. Again, would significantly reduce the sample rate and also the number of samples.
-- More speed. The fastest we can sample is 5.33MHz and the timing isn't ideal with the OLS client so 4MHz is it right now. The 5.33MHz rate might be usable with some tweaks with the OLS client or settings. I'm not sure here, but 4MHz to 5.33MHz might not be worth the effort. If you really need it faster, the OLS hardware does 200MHz loosely and 100MHz is precise timing.

Some of these features might be nice for an alternative firmware with lower samples rates. I'm just not sure it is worth the effort for 100kHz or 10kHz sample rates rather than just using the OLS. One of my goals was to have generally straight-forward code for an Arduino and I think so far I have been able to do it fairly well.

I'm thinking of reorganizing the repository to have separate directories for versions like megaram or ethernet, in addition a main one that supports most boards via #ifdef like currently. That way test, PoC or alternative versions (like Leonardo or Due or Cypress EZ-USZB) could be on the main branch in their own directories.

Feedback & suggestions welcomed, but no guarantees on getting to them. :wink: