Which logic analyzer? - Page 1
Forum section: electronics / beginners

author: robdejonge
author_rank: Regular Contributor
timestamp: October 27, 2018, 09:53:08 am
content: I'm increasingly getting myself into home automation, and playing with microcontrollers. I do not design my own circuits or anything, simply don't have the knowledge to do that just yet. But I have noticed a desire to be able to 'listen in' on communication between a microcontroller and a sensor, or something similar. So I've decided to get a logic analyzer. I can't afford a fancy scope, but can spend up to maybe $150 on a USB logic analyzer. The way I look at this is this will allow me to 'debug' communication between components, similar to how I use debug statements in software development.So now .... I am facing the challenge of selecting one. Two main things seem to be important. First, the bandwidth and second the sample rate. I foundthis write uptrying to explain it, but I failed to comprehend. So let me ask it in a typical newbie style ...The fastest microcontroller I use is the ESP32.What sample rate is required to adequately handle the fastest signal that comes out of that?

author: Gyro
author_rank: Super Contributor
timestamp: October 27, 2018, 10:05:37 am
content: Welcome.You may have your financial priorities the wrong way round. I would be tempted to purchase one of those <$10 8 bit Saleae clone logic analysers from ebay and use it with open source Sigrok Pulseview. If it doesn't meet your speed needs, then nothing much lost. It should be fast enough for general comms with sensors, protocol decoding etc.Reserve the remainder of your money for a scope of some description, maybe a used analogue, maybe a USB one. Many problems with communication are caused by signal integrity issues, noise, dodgy logic levels etc. which a logic analyser will never see. At the same time, it gives you have a useful instrument for general debugging.

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: October 27, 2018, 10:22:45 am
content: The topic has been discussed quite a few times here. I think the last time it was here:https://www.eevblog.com/forum/testgear/cheap-usb-logic-analyzer/msg1875170/#msg1875170In a nutshell: typically, the fastest protocol you will look at in the typical hobby scenario is SPI which goes up in the few MHz range (yeah, some people crank it up to 20Mhz or so but it's not really mean to).Since you want to use a multiple of the fastest clock as sample rate, a logic analyzer should be able to sample with 100MSa/s or more.However then there's the question whether the LA will store the sampled data in RAM (which limits amount of data it can capture) or if it transfers the data through USB (where the USB bandwidth limits the amount of data that can be transferred). Like just because an LA samples with 200MSa/s, this doesn't mean you can rely on a 15MHz clock signal to be sampled correctly if the transfer happens via USB2.IMHO the best choice is to combine local RAM and USB transfer. So my typical recommendation at this point would be to look out for aDSLogic Plus. Note that only the Plus version has the local RAM and only the newest HW revision has a certified driver for Win10. eBay sellers will typically try to sell the Basic version without SRAM or an older version of the Plus which doesn't have a certified Win10 driver.Personally, I still use my Ikalogic ScanaPlus most of the time (though I also own two DSLogic Plus which I use where the ScanaPlus fails) and will surely have a look at the newSP209as soon as it's out. Unfortunately, the ScanaPlus is no longer available for quite some time and the SP209 will be more in the 300€ range.

author: robdejonge
author_rank: Regular Contributor
timestamp: October 27, 2018, 10:38:12 am
content: Thanks for the pointer, Gyro. A good friend keeps telling me to get a scope too, yet stubbornly I refuse to listen and focus on the realm I understand: digital. I have secretly been looking at second-hand ads too, but have so far not found anything of interest (Dutchman, living in Bangkok). I appreciate the suggestion that issues often stem from poor signal rather than signal content. I understand that.What a super helpful response, 0xdeadbeef. Thank you for that. And my apologies for not first searching the forum. Thank you for taking the time to write that all up. I had been looking at the DSLogic Plus and was wondering if the Hantek 6022BL with its lower sample rate would suffice. But I'll be ordering the DSLogic Plus. Thanks again!

author: tggzzz
author_rank: Super Contributor
timestamp: October 27, 2018, 08:25:16 pm
content: Quote from: robdejonge on October 27, 2018, 10:38:12 amThe only digital circuits are fentoamp circuits and photon counting circuits; everything else is analogue.What you think of as digital circuits are actually analogue circuits where the voltage/current is interpreted to be digital.So, get a scope so that you can verify your analogue signals will be correctly interpreted as digital signals ( a.k.a. signal integrity). Then flip to the digital domain and use digital tools such as logic and protocol analysers.

author: Wimberleytech
author_rank: Super Contributor
timestamp: October 27, 2018, 09:12:21 pm
content: Four or five years ago, I got in a bind designing a little system using SPI and I2C. I am an analog guy. I bought the Saleae 8 channel analyzer and it saved my butt.I was so impressed, that I talked with them about investing...and almost did, but concluded that it is a challenging space (as evidenced by the knockoffs mentioned here).

author: malagas_on_fire
author_rank: Frequent Contributor
timestamp: October 27, 2018, 09:21:45 pm
content: I used recently a pickit 2 as logic analyser for monituring 1 Wire signals. Not the best tool since it is limited to 1MHz i believe, but the cheapo salaee should get you on the road.

author: robdejonge
author_rank: Regular Contributor
timestamp: October 28, 2018, 07:47:34 am
content: Thanks for your comment, @tggzzz. Your and @Gyro's comments certainly convinced me to consider investing in a scope.Now here is a question. USB-connected scope or a dedicated device? Let's say spec-wise, they are both sufficient. But the dedicated device is more expensive, because, well you're buying more components really. I come from a software background and so to me it makes so much more sense to have things on a general purpose screen, with mouse control and whatever.Thoughts?

author: Fred27
author_rank: Unknown
timestamp: October 28, 2018, 08:31:55 am
content: I'd say definitely start with a cheap logic analyser. It will very likely do everything you need for debugging microcontroller stuff at the moment.When you do get to the point that a logic analyser is not up to the job you'll have a bit more experience and knowledge. The answer at this point is likely to be "Rigol DS1054Z" but by then they might be cheaper or something better may have come along.

author: robdejonge
author_rank: Regular Contributor
timestamp: October 28, 2018, 08:33:47 am
content: Thanks, by "cheap" do you mean the $7 numbers I see, or something like the DSLogic Plus?

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 28, 2018, 08:45:01 am
content: I got anAnalog Discovery 2, being in a roughly similar situation. With the academic discount, I paid a total of 200€ including shipping (from Kamami).The clincher for me was that it has two true differential input channels, max. ±25 V, at 100 Msamples/s with a 14-bit ADC. (The inputs are protected up to ±50 V.) It has an arbitrary waveform generator, 16-channel 100 Msamples/s logic analyzer, and other goodies; check the specs. The Waveforms suite has an SDK you can use to interface your own programs to the device.I do also have a cheap Saleae clone that works really well in PulseView (part of Sigrok); Sigrok uses its own firmware for it, so there's no issue in using the cheap $7 clones with it.

author: tggzzz
author_rank: Super Contributor
timestamp: October 28, 2018, 08:56:18 am
content: Things to look for in logic analysers...Cheap logic analysers: probing and how many grounds there are? They are vital for signal integrity. Don't be fooled into thinking "I am only looking at a 10kHz clock" or "you need sampling/bandwidth of 5* the clock frequency" - even at 10kHz modern jellybean logic can have risetimes of <1ns and harmonics into the GHz region. FFI, seehttps://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/Triggering and filtering capabilities. There's little use in having megasamples if you can't find the ones you need! Triggering allows you to wait (hours if necessary) for the problem to manifest itself. Filtering allows you to ignore irrelevant data - most digital circuits are synchronous, so only capture the signals when the circuit will "look at" them: the clock edges.

author: 0xdeadbeef
author_rank: Super Contributor
timestamp: November 09, 2018, 11:23:04 pm
content: For the record: you can useZadigunder Win10 to install a WinUSB driver that works with the newest version of DSView. So even the older versions of DsLogic can be used under Win10 without circumventing driver signature certification. Did this today in the company (where disabling driver certification would trigger the BitLocker password) and it worked like a charm. I couldn't tell any difference to the official driver. Bad news is that even the newest version of the SW doesn't let you change the color presets to something more eye/printer friendly.Quote from: 0xdeadbeef on October 27, 2018, 10:22:45 am

author: rstofer
author_rank: Super Contributor
timestamp: November 10, 2018, 01:03:53 am
content: For $150, you are in the realm of a logic analyzer of some kind. References given above...If you are just starting out with electronics and don't have any test equipment, the Analog Discovery 2 is the way to go. 16 digital pins with input or output and usable as a logic analyzer. Dual channel arbitrary waveform generator, a dual power supply (current is limited, may want an external wall wart) and software to create an entire lab of instruments. But still closer to $300 than $150. Download and play with the free Waveforms software in Demo Mode.Finally, the Rigol DS1054Z is less than $400 (but nowhere close to $150) and it will decode SPI, I2C and Serial on the screen.The thing about logic analyzers is that they are just logic analyzers and almost useless for anything analog - like amplifiers or filters. They are also questionable when timing is tight and you really do want to see that SPI CS* goes high after the last bit is shifted out. I have a logic analyzer (https://www.sump.org/projects/analyzer/) but I use a scope much more often.One thing to look for in a logic analyzer is external clock input (called state clock). This is just about required to troubleshoot digital circuits with any kind of logical state and state transition. Typically the logic will set up some next state and change to that state on the clock edge. That's what you want to see, the current state changing to the next state. The state value is usually a fairly wide set of digital signals. If this doesn't seem important now, it might not be. But it will!

author: tggzzz
author_rank: Super Contributor
timestamp: November 10, 2018, 09:24:00 am
content: Quote from: rstofer on November 10, 2018, 01:03:53 amI agree with the above, and will note...I am told the Rigol will only decode what is on the screen. I suspect that makes it of little use with long data comms and/or for triggering on a specific message.Grounding is important, something that is missed in a lot of cheap amateur stuff.For high speed signals every signal should have an associated ground, but that almost certainly isn't necessary in this use case. But good enough grounding is important to ensure the signal integrity of the voltages that the logic analyser "sees". That is especially true for any external clock signal, since if that is unreliable then all the captured data is unreliable.I have seen some cheap LAs with an external clock but without an associated ground; I would never buy such a thing.

author: roncromberge
author_rank: Newbie
timestamp: November 10, 2018, 10:10:49 am
content: Hello,I don't know if these logic analyzers and YouTube movies already mentioned in this thread? But the are worth looking at.https://youtu.be/dobU-b0_L1Ihttps://youtu.be/xZ5wKYnCNcsVerzonden vanaf mijn iPad met Tapatalk

author: roncromberge
author_rank: Newbie
timestamp: November 10, 2018, 10:17:05 am
content: Just another video.https://youtu.be/4FOkJLp_PUwVerzonden vanaf mijn iPad met Tapatalk

author: rstofer
author_rank: Super Contributor
timestamp: November 10, 2018, 04:37:15 pm
content: Quote from: tggzzz on November 10, 2018, 09:24:00 amThat is true! The thing is, I just want to see a single frame. I am interested in the state of the clock with CS* goes low, the subsequent data transitions relative to the clock and the fact that all the data has shifted before CS* goes high. I don't need to decode "War and Peace", just a single short frame to verify timing. Everything else can be done with printf().After I get the LA trace, I can compare the actual timing to the datasheet. To do this accurately, I probably need to sample at somewhere around 10x the signal rate. That's why I built the 200 MHz Sump analyzer. One of my projects is clocking SPI at around 12.5 MHz. I was in a hurry, I guess.

author: tggzzz
author_rank: Super Contributor
timestamp: November 10, 2018, 04:47:48 pm
content: Quote from: rstofer on November 10, 2018, 04:37:15 pmJust so. That's signal integrity, which is best done with a scope. If that's all you want then there's little need for an LA.LAs excel with complex arm/trigger/capture options, e.g. if X occurs more than 52 clock1s after Y then wait 12ms and capture all 64 bits on the databus on the rising edge of clock2 when Z is inactive. The extent to which that can be done with a scope would be very scope-specific, or with printfs it would be application dependent.

author: rstofer
author_rank: Super Contributor
timestamp: November 10, 2018, 11:12:23 pm
content: I built the Sump.org LA because it offered layers of triggering across all 32 channels. If this, then if that, then if the other thing, occurred in that order, start sampling. Very powerful!The FPGA board I was using at the time had 50 pin headers and it was possible to bring out a full 32 signals plus the state clock. Since everything in the logic was referenced to the state clock, this was about as good as it could get. The logic was running at 50 MHz and the LA ran at 200 MHz (16 channels) or 100 MHz (32 channels) (IIRC).The Java client application runs on Linux (easier) or Windows (a PITA to set up). All in, the tool was quite helpful.But the thing is, I was looking at logic that might be running a million cycles in as the OS was trying to boot and getting hung. I had to gin up logic to create trigger events to see what was happening. It was all very educational.What did I learn? One-hot encoding doesn't work well with LAs because the state word is too wide (over 100 bits for my project) so I had to create additional signals within the FSAs. Integer encoding is easier to debug but requires additional decoding logic in the project itself. I stayed with one-hot and created the triggers. A scope is definitely not the right tool for this kind of thing. Maybe an MSO but those get pricey and they aren't a really good substitute either.I don't see either tool, LA or scope, as being acceptable replacements for the other. They do different things in different ways and both have a place on the bench. But the order in which they are needed may favor buying one before the other. Price is also a factor. If a LA will do the job, it will likely be a lot cheaper than a scope with decoding.

author: tggzzz
author_rank: Super Contributor
timestamp: November 11, 2018, 01:21:12 am
content: Quote from: rstofer on November 10, 2018, 11:12:23 pmPrecisely. Screwdrivers for screws and spanners for nuts.Decent LAs aren't cheap either. Plus when considering either a scope or LA, appropriate probes are vital and surprisingly expensive for "mere bits of wire", ahem.

author: 2N3055
author_rank: Super Contributor
timestamp: November 11, 2018, 01:29:59 pm
content: I find Digital Discovery to be very useful.It can be used as simple pattern generator. It has huge memory depth compared to others cheap ones. You can do scripting, ROM logic etc etc..It has protocoltriggersanddecodesand cangenerateUART,SPI, I2C, CAN. It can also work in sniffer mode.All in all very useful.Software is meh but kinda works...Regards,Sinisa

author: rstofer
author_rank: Super Contributor
timestamp: November 11, 2018, 04:06:03 pm
content: Quote from: 2N3055 on November 11, 2018, 01:29:59 pmYes, indeed! I have the Digital Discovery (along with the Analog Discovery2) and the only reason I didn't mention it is that the AD2 has so many more features that are useful when other equipment is scarce. Given a signal generator, scope and whatever, already on the bench, adding the Digital Discovery makes a lot of sense.The DD could be the first bit of equipment if a person only wants to do digital but as soon as they turn around, they're going to be stuck. There is always an application for measuring analog kinds of things.

author: 2N3055
author_rank: Super Contributor
timestamp: November 11, 2018, 04:29:47 pm
content: Quote from: rstofer on November 11, 2018, 04:06:03 pmYou are completely right about that. Topic is logic analysers (digital only), so I just pointed out that DD is superior in some regards to many other LA mentioned.But as a single device AD2 is unsurpassed in how useful it is....Regards,Sinisa

author: Housedad
author_rank: Frequent Contributor
timestamp: November 13, 2018, 08:09:13 am
content: From what I have done with it, I am very happy with my Digital Discovery.Yes, it is not as versatile as the AD, but it does digital alone far better, IMO.I have all the other test instruments, and wanted an LA for micro controller development. It fits that bill just right.If you use the ms/s divided by 5 equals usable bandwidth, and keep in mind the DD and the Saleae are both hardware limited to a maximum of 100MHZ bandwidth, the Digital discovery upper limits become:https://reference.digilentinc.com/reference/instrumentation/digital-discovery/reference-manual8 channels at 800 ms/s max 100 mhz16 channels at 400 ms/s max 80 mhz32 channels at 200 ms/s max 40 mhzThe Saleae 16 limits are:https://www.saleae.com/performance-calculator/6 channels at 500 ms/s max 100 mhz8 channels at 250 ms/s max 50 mhz16 channels at 125 ms/s max 25 mhzkeep in mind the Saleae 16 is four to five times the price of the Digital discovery and has less bandwidth the more channels you add, and has half the number of channels at half the bandwidth at the far endThe only advantages Saleae has in my opinion, is better software and it can do rather low bandwidth analog signals. For pure digital though, I think the Digital Discovery beats it hands down.

author: Housedad
author_rank: Frequent Contributor
timestamp: November 13, 2018, 09:53:39 am
content: To be totally fair and honest, I should add in the Saleae 16 analog specs too. (Saleae says to divide by 10)up to 5 channels 50ms/s max 5 mhzover 5 to 16 channels 12.5 ms/s max 1.25 mhz12 bits resolution ADC(The Analog discovery 2 is two oscilloscope channels at 14 bits ADC, and 30mhz)

author: 2N3055
author_rank: Super Contributor
timestamp: November 13, 2018, 10:42:49 am
content: One thing DD has is quite sophisticated triggering.Saleae has only edge and pulse width trigger. DD can trigger on protocols among other things.Also, I used pattern generator many times for testing devices. Very useful.

author: malagas_on_fire
author_rank: Frequent Contributor
timestamp: November 13, 2018, 12:05:44 pm
content: Well this is more of a question than providing a solution.Does anyone knows about perytech products?What about this logic analyzer :https://ebay.us/vulmL2The listening has a lot of description , FCC and CE compliancy and a compreensive software but i don't see any included acessories, such as probes.[Edit ]I was talking rubbish on acessories, sorry:"Accessories: External box, Logic-Analyzer, LA-Clips, Clip Line, disc, USB 2.0 cable."

author: ajb
author_rank: Super Contributor
timestamp: November 15, 2018, 07:48:18 pm
content: Quote from: rstofer on November 10, 2018, 04:37:15 pmYeah, but the Rigol decoding is so fucking bad that it's hard to use even on a single frame, especially if that frame is 16+ bits.If you're doing only 8-bit CS-framed SPI transactions, it's okay, but anything more than that is just awful. What makes it even worse is that if a frame is partially offscreen, it doesn't just fail to decode that section, itdecodes it incorrectly. And ifthatwasn't bad enough, it can fuck up the entire rest of the frame! It will even fuck up multi-byte UART messages if the first start bit is off screen. If you aren't zoomed in enough, some of the bit decoding becomes marginal and it will just sit there and flip bits randomly on repeated captures. It's so bad that it's borderline harmful, because there are so many conditions that can cause it to display misleading or outright wrong decoding.