Hey r/electronics, I'm designing a cheap and versatile logic analyser, and I need your input!

I'm designing a logic analyser based on a PIC24F. The objective is to make it as cheap, small and powerful as possible - a bit like the Salae logic analyser, but below the £10 mark to fabricate on a small scale. I'm considering releasing it as a kit for hobbyists when I'm done. I would like your input on features to add.

The idea here is to pack as much punch into as small and cheap a package as possible to give hobbyists a comprehensive set of tools for electronics development. What features would you like to see?

So far, the design has the following features

  • Tiny. Fits in a 40x18x28mm project box.
  • USB full speed (12MBit) connectivity
  • Wide input voltage range. This kind of depends on which chip I ultimately choose to buffer the input down to the 3.3V the PIC uses, but it should definitely handle logic at 0.5-5V at least.
  • Choice of 16 bit or 8 bit samples
  • 7kb sample buffer. 7168 samples @ 8 bits/sample or 3584 samples @ 16 bits/sample
  • Choice of sample rate. For 16 bit, 16MHz or 2MHz-65kHz. For 8 bit, 32MHz or 4MHz - 125kHz.
  • Burst capture only (based on optional trigger)
  • Choice of trigger sources. Only one level of trigger. So far I have no trigger, rising/falling edge on any channel, counter (wait for n rising/falling edges on any channel), and trigger on value (equal|greater than or equal to|less than or equal to|not equal to) sample&mask.
  • Variable trigger position. Position of the trigger sample within the capture buffer can be varied, allowing you to control how many samples/before after the trigger you want.
  • Frequency meter mode. Measure the frequency of any logic signal up to 50MHz
  • Counter mode. Count rising/falling edges from a source signal up to 50MHz. Counter is 32 bit and can be polled repeatedly (not sure how frequently yet, depends on USB overhead)

I'm also considering adding some kind of signal generator features but I'm not sure what that'll do to the part count (which I'm trying to keep as small as possible).

I'm not writing a device specific driver to power this (I'm using WinUSB to do the USB control) so the device will have to be controlled by a specific software application. I'm not planning on writing my own wave viewing software - I'm using an open source solution for now. The software for the prototype so far simply provides an interface to capture data from the device, save it to a .vcd which can then be loaded into a wave viewer of your choice.

Your suggestions would be really helpful. Thanks :)

Posted Dec 31, 2010, 3:10 PM UTC

1123
spainguyretired, but never had an office job,ever•

Could it handle differential LVDS, RS422/485 inputs as well.

How robust is the front end, ESD, 12Vdc

Just asking

2
d1257•

Yeah, front end robustness is important. Particularly as you expect statically charged humans to touch the probes frequently, and to connect and disconnect them in random sequences to powered circuits.

1
spainguyretired, but never had an office job,ever•

Another thing (just being awkward) the input buffer chip should be socketed, and should be generic, not single sourced

3
d1257•

I'd say the input buffer should be either socketed OR fairly robust. Both seems overkill. For example, you very seldom come across a commercial electronics instrument with a blown voltage input. (YMMV).

1
spainguyretired, but never had an office job,ever•

True, maybe a i/p pcb with a SIL connector, going to the PIC machinery could be an idea, means swappability for unbalanced/differential signals. I think nuticulus is a bit optimistic on the pricing, even 20€$ for a little box like this wouldn't break the bank.

Sounds like a great little project

1
nuticulusOP•

Hmm haven't put that much thought into the front end. I'm pretty sure I won't be able to make this thing galvanically isolated for under £10.

The simplest ideal uses 16 transistor buffers (using a transistor array chip). Surface mount, not through hole, to save on space. I suppose I could try and find surface mount sockets, but they might end up being too big. ESD/max voltage will be determined by whatever the transistors can handle.

1
crwper•

A couple of thoughts:

  • The buffer size sounds really small. Using the Saleae analyzer, I often record a million samples or more, so that I can capture several rounds of communication between two devices. 7000 samples would be of minimal use in most of those cases.

  • My impression is that most logic analyzers use 1-bit samples, because what you're most interested in is analyzing communication between devices, as opposed to looking at the precise waveform. What you're building sounds a bit more like a digital oscilloscope than a logic analyzer.

  • The analysis software will be at least as important as your hardware. One of the things that stands out, in my mind, with the Saleae analyzer is the software. It's simple, and makes it really easy to acquire data and then analyse it. Does GTKWave support this?

Edit: What's your long-term goal with this project? You mentioned you'd like to sell it as a kit, but do you have any thoughts on how you might market it, or how many you'd expect to sell?

2
nuticulusOP•

tbh there isn't really a long term goal, i started this project with the objective of learning how to do USB communication on the PIC24F and provide myself with a cheap logic analyser (I don't have one because they're expensive). I realised later that it'd be really handy for other people, which is why I figured I might try releasing it as a kit.

3
nuticulusOP•

ah I see I wasn't clear: I mean 8/16 channels each with 1 bit/channel depth.

sample depth might be an issue... it won't get much higher than 7000 samples.

2
crwper•

Thanks for clarifying. Even for personal use, I'd give some serious thought to increasing the buffer size. I've found my Saleae analyzer absolutely indispensable on a number of occasions, but a limitation on buffer size would have put a serious damper on that. Have you looked at external memory?

1
frank26080115•

What you have planned so far is very impressive for $16

I can get a pretty decent hobbyist level logic analyzer for about $50 these days.

http://iteadstudio.com/store/index.php?main_page=product_info&cPath=29_31&products_id=221

http://www.seeedstudio.com/depot/open-workbench-logic-sniffer-p-612.html?cPath=174

The Logic Sniffer is great in terms of hardware performance but the software sucks compared to the ones available for the Mini Logic. The Mini Logic can even analyze USB.

Since these features already exist in other products, my opinion is that your best bet is to replicate as many of these features as possible while lowering the price, instead of adding new features. A lot of the work is in software anyways, if your software sucks, I won't buy your hardware, unless you can really hit that $16 price point.

2
eclectro•

Agreed. A lot of them can now analyze RS232/CAN/I^2

And you're right about the software being sucky. This is where the open source projects fall short. I almost wish he'd drop the hardware and work on the logic sniffer software.

1
d1257•

Can you post a link to the open source wave viewing software you plan on using?

1
nuticulusOP•

atm I'm using gtkwave.

1
d1257•

A quick look indicates that "GTKWave reads LXT, LXT2, VZT, FST, and GHW files as well as standard Verilog VCD/EVCD files and allows their viewing."

Can I ask how you are creating the files and getting them to GTKWave? Does it allow near 'realtime' viewing of waveforms?

1
nuticulusOP•

yep. I have an interface (a toolbar window) with a bunch of controls for the capture. You specify what you want, and a file to save the capture to, and hit go. You pull up GTKWave alongside your toolbar window and tell it to reload the waveform file, and voila.

I might consider writing a plugin for an open source client called sigrok, although gtkwave seems to work fine right now.

1
[deleted]•

What kind of input: a logic 0 or a 1? Also, CMOS or TTL?

1
r00x•

That sounds like an awesome feature set, but I am a little concerned about the number of samples you'd have at your disposal there.

At 32MHz, 8 bit, won't your sample buffer will be filled in 0.000028 seconds? Or 0.000014 seconds in a 16MHz, 16 bit run? Unless I've horribly misinterpreted something, those are rather small sample windows! Could you try to implement a way to stream the data back to the PC for a longer sampling period?

Salae struggled with their USB logic analyser because the bandwidth at such high sample rates was excessive. I myself often find sampling at top speed (24MHz/8 bit) can slaughter the USB 2.0 connection, which can't keep up all the time.

1
nuticulusOP•

Yeah it is a very limited at high speed. I have added a "continuous capture" feature that streams data from the device to the PC, but that's limited by the USB bandwidth (and since the PIC can only do USB full speed, this limits it to 1MHz@8channels / 500kHz@16 channels).

Still, 1MHz is fast enough to, say, sample an I2C bus @400kHz clock, so it clearly has its uses. Hopefully with the menagerie of trigger options I've added, the problems of a small sample buffer shouldn't be difficult to overcome (i.e. trigger only when you want samples).

1
tty2•

The objective is to make it as cheap, small and powerful as possible - a bit like the Salae logic analyser, but below the £10 mark to fabricate on a small scale

Have you ever designed/fabricated chips before? You're not going to get this, no way. Not doing it independently on a small-scale.

0
nuticulusOP•

I have a parts count right here and the cost is less than £10 for me to make. So far, the most expensive component is just the PIC itself (£2.43 ex. VAT). After that, the parts are inexpensive. An 8 bit latch, a buffer, a voltage regulator and a mini USB connector, some passive components and the pcb which I can etch myself.

2
tty2•

Oh you just want to make a board for it all? Sounded like you wanted to make a chip yourself to do most of the work based on the PIC.

2
nuticulusOP•

Yeah the PIC does all the work: triggering, capturing the data then sending it back.

2
[deleted]•

[deleted]

0