USB logic analyzer/scope with Sigrok, apprentice project? - Page 1
Forum section: electronics / projects

author: Martinn
author_rank: Frequent Contributor
timestamp: June 30, 2023, 05:42:25 pm
content: Hi all,I recently discussed with a colleague that we could saturate our R&D, both company- and home-office-workplaces, with cheap Saleae-logic like USB analyzers as they would be sufficient for 90% of our work (with SPI, I2C or other serial decoding). Unfortunately the original Saleae logic was discontinued long ago and instead of buying a heap of clones, I thought we could design our own, throwing in one or two analog channels, based on the sigrokhttps://sigrok.org/wiki/Fx2lafwfirmware, using sigrok Pulseview as UI and have it manufactured by JLCPCB (maybe 30-50 pcs). It would be uneconomical to design it based on engineers' rates, but for apprentices it would be a fun project.There seem to be a few designs around (examplehttps://www.hkepc.com/forum/viewthread.php?fid=146&tid=2422832&page=1), essentially it's just the FX2 USB controller with some input protection on the digital lines and an ADC for analog signals. I would like a few more features on the analog side (like input ranges 0.5, 5 and 50 V AC/DC, maybe differential or isolated), but nothing too fancy.Any opinions on that? Is sigrok the way to go for a simple mixed signal device? Any similar existing projects that would be worth looking at? Not sure if a two A/D channel device would be possible using this setup, in the firmware page linked above only single analog channel devices seem supported.Any ideas?Thanks, Martin

author: RoGeorge
author_rank: Super Contributor
timestamp: July 01, 2023, 06:04:55 am
content: DreamSourceLab has a logic analyzer DSlogichttps://www.dreamsourcelab.com/product/dslogic-series/that can use an analog header.Another option might be Analog Discovery from Digilenthttps://digilent.com/shop/analog-discovery-2-100ms-s-usb-oscilloscope-logic-analyzer-and-variable-power-supply/has some adapter board, too, with BNC connectors for oscilloscope probes.Both are open source designs, both can be bought ready assembled.

author: NiHaoMike
author_rank: Super Contributor
timestamp: July 01, 2023, 12:36:47 pm
content: Have you considered Beaglebone Black? I have seen them used by the many dozens inside test racks, it helps that they also work as bus interfaces.FX2 is pretty antiquated by now, a new design should be based around the FX3.

author: coromonadalix
author_rank: Super Contributor
timestamp: July 01, 2023, 01:19:34 pm
content: https://sysprogs.com/w/how-we-turned-8-popular-stm32-boards-into-powerful-logic-analyzers/but sure they need some front end designs ...

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 01, 2023, 01:31:48 pm
content: If one implements a high-speed USB 2.0 (480 Mbit/s) logic analyzer for Sigrok, I would recommend making it with an USB isolator (high-speed USB isolators recently become affordable), and able to continuously stream the data to the host, either by having sufficient buffers, or using isochronous transfers, the latter being preferable.Similarly, a 9 to 15-bit single- or dual-channel ADC, with a suitable isolated frontend with a small microcontroller with native high-speed USB would be useful for us hobbyists. The bandwidth would be small, just 20 MHz or so, but the ability to stream the data continuously to a PC host would really be useful; and having a digitally isolated frontend would allow safe measurements without worrying about ground currents or current loops. Again, Sigrok can easily provide an oscilloscope-like interface, but I personally might just use a custom GUI client with rolling storage (i.e., having say the last minute always recorded to a circular buffer, which can be saved whenever interesting stuff has happened).FX2 is sufficient for this, because of its GPIF interface. The 8051 in it can be programmed with SDCC (see Sigrok fx2lafw), and will simply respond to USB events, and not actually move the data; the GPIF interface will handle the bulk data.I play a lot with Linux single-board computers and routers (running OpenWRT), and a single combined logic and voltage probe I can program myself on the host side would be often useful. For example, when looking for a serial interface, I can easily whip up a fast library that will detect typical UART formats from analog (8/16-bit voltage-sampled) data, and determine the format, baud rate, and voltage level. It would benice, not to mention very useful for exploring new hardware. Just a couple (signal and arbitrary ground) of hook probes, and pokey-pokey, without worry of breaking something, as long as the probe can handle ±24V with respect to its ground counterpart.In fact, I've already gathered most of the components to do this on a Teensy 4.0. Even with USB Serial, I can reliably sustain 200 Mbit/s in Linux, and the 12.5 MHz bandwidth would suffice for UARTs. I can even do tricky stuff, like use the FlexIO and DMA to sample a logic level at up to 240 MHz (say, 120 MHz in practice for the digital probe), if I add a suitable buffer/frontend (I'd probably want a configurable lo/hi voltage level). Each byte transferred then has eight consecutive logic level samples in time. Unfortunately, I'm just a hobbyist on the electronics side, and RF stuff is outside my ken, so it is exactly the front-ends that makes this difficult for myself.

author: coromonadalix
author_rank: Super Contributor
timestamp: July 01, 2023, 03:22:14 pm
content: for the teensyhttps://github.com/LAtimes2/TeensyLogicAnalyzerfor some front ends you had the open logic sniffer, had one of theses never thruly worked, used the fx2 cheap board to help on some project here, worked very welltried saelae logic, sure pricey ...dslogic seems a good replacementtried the previous stm link i provided, some of the pcb are not expensives, but they ask $$$ for the software side around 35$ usd if i recall

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 01, 2023, 03:55:43 pm
content: I can handle my own software (both the Teensy side, as well as Linux libraries and GUI); it's the RF frontend that stymies me.Teensy 4.x can do up to 240 MHz using FlexIO and DMA, and I think 16 pins (individually) might be possible on Teensy 4.x (using FlexIO1 and FlexIO2). The aforementioned TeensyLogicAnalyzer doesn't use any of that.

author: Martinn
author_rank: Frequent Contributor
timestamp: July 01, 2023, 05:06:54 pm
content: Quote from: RoGeorge on July 01, 2023, 06:04:55 amI have seen both, but they are on the expensive side.I am considering to solve the problem of useful stuff not being there where you need it (philips screwdriver, unmarred wire cutter) usingsaturation- just buy so many of those that there's always one around. This can easily be done with small spoons or screwdrivers, but not with active scope or current probes. Analog discovery and DSlogic are fine, but far too expensive to buy let's say 50 of those with no other justification to management than people being too lazy to keep track of them.Also hardware is closed source as far as I found out.Now, while the fx2 are really slow and primitive, in practise they are sufficient for most of the (embedded low power) work we are doing. We have tons of MSOs if there would be a need, but I have rarely seen the digital functions being used - most of the time, a small Saleae does the job just fine and is easier to work with than some ex-HP MSO.Quote from: NiHaoMike on July 01, 2023, 12:36:47 pmBeagle: There's beaglelogic, but no analog support.FX2 mostly is sufficient, why use FX3? Also FX3 support still seems not implementedhttps://github.com/sigrokproject/libsigrok/pull/148Quote from: coromonadalix on July 01, 2023, 01:19:34 pmPaid, closed sourceQuote from: Nominal Animal on July 01, 2023, 01:31:48 pmUSB isolator might be an idea, isolated ADC as well (or differential with sufficiently high CM range). Isolated is probably more versatile.TeensyLA: Interesting... seems abandoned though.Again, as the idea was to place this as an apprentice's job, difficulty has to be on a beginner level.I just purchased ahttps://sigrok.org/wiki/Noname_LHT00SU1which is truly primitive, fx2 with 8 bit 20 MS/s 8 bit ADC. But this could be just the basis. Add isolation and a bit more sophisticated front-end (AC coupling, maybe 3 voltage ranges) might be just OK and in the range a beginner could master with some help.

author: prosper
author_rank: Regular Contributor
timestamp: July 03, 2023, 01:59:13 am
content: what about the rp2040? with its pios, it should be possible to turn it into a small logic analyzer, possibly similar in performance to the fx2. And it has ADCs and DMA for your analog ideas, too. you'd need to spend some time on sigrok to build out support for it

author: wasedadoc
author_rank: Super Contributor
timestamp: July 03, 2023, 07:18:21 am
content: Quote from: prosper on July 03, 2023, 01:59:13 amTwo to look at:https://forums.raspberrypi.com/viewtopic.php?t=304041https://forums.raspberrypi.com/viewtopic.php?t=350300

author: BBBbbb
author_rank: Unknown
timestamp: July 03, 2023, 07:44:22 am
content: Quote from: RoGeorge on July 01, 2023, 06:04:55 amThey are not open source, they just got caught with sigrok's GPL'ed code and had to opensource their SW to comply. There are suspicions that their current FW is infringing on the FX2 FW GPL as well.They are the opposite of open source.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 03, 2023, 08:06:00 am
content: The DSView app is open source as it can be. I built it from source on Mac, and it works fine.If you really want you can plug the pico hardware definition into it and use DSView as your Sigrok UI.

author: BBBbbb
author_rank: Unknown
timestamp: July 03, 2023, 10:48:43 am
content: Quote from: dobsonr741 on July 03, 2023, 08:06:00 amLet me correct that for you:The DSView app is open source as it had to be after threatening emails from Sigrok pointing to proof of GPL infringement.There are no proofs for the FW, but quite reasonable doubts it does the same.Companies behaving this way only hurt the FOSS space.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 03, 2023, 11:08:26 am
content: There are plenty of < EUR10 Logic analyser boxes from Ebay or Ali, wich are clones of the original 8-bit Saleaeaea and with this form factor:https://sigrok.org/wiki/MCU123_Saleae_Logic_cloneEven Adafruit, Seeed, and more sell these boxes, although those tend to be about twice the price of the Chinese versions.Also note that the Cypress CY7C68013 does not have Flash. Firmware is uploaded at the moment it's plugged into an USB port (I guess it uses DFU). So if you use it with Sigrok, it puts in the Fx2Lafw firmware, so there are no infringements. The boards are just some hardware (lots of photo's on the Sigrok/Hardware site).Due to concentration problems, I have not done much with uC's lately, but I really like the Sigrok project and have bought a few of these CY7C68013 LA's. I even have a few with the 100 pin variant IC, and it also works. I have also bought a few generic CY7C68013 boards, and Sigrok shows them as 16 channel boards. I assume Sigrok does this just because of the I2C ID or similar. These generic boards do not have I/O protection though.CY7C68013 is good enough for sniffing some serial, SPI and I2C channels (Sigrok has over 100 built in decoders), but I would like some more speed in my logic analyzer. And I've looked around a bit, and it's hard to find anything below EUR100.I think it would be quite doable to port the FX2LAFL to either an STM32 or a Teensy4 and then increase the channels and sample rate a bit. I would gladly pay EUR50 for such a board if it works with Sigrok. If I could find enough concentration to work on uC projects these days, it would be on top of my list to do this, and try to breathe some more life back into the Sigrok project. Latest news on the Sigrok site is now over 2 years old and it's starting to suffer from bitrot. Note thathttps://sigrok.org/wiki/Downloadssuggests to use archive.org to download a nighty due to "issues with the build server".A few years ago I also had a look at FX3, but a development board back then costed around EUR80 and that was too much for me.Hantek also has an "USB Scope & Logic analyzer", that presumably works with Sigrok (though either analog or digital, but not both at the same time).https://sigrok.org/wiki/Hantek_6022BL

author: wasedadoc
author_rank: Super Contributor
timestamp: July 03, 2023, 03:12:38 pm
content: Quote from: Doctorandus_P on July 03, 2023, 11:08:26 amAIUI the original Saleae hardware was pretty much just a copy of a design in a Cypress Application Note.

author: coromonadalix
author_rank: Super Contributor
timestamp: July 03, 2023, 05:51:05 pm
content: seems you have all you need to decide on a designbeyond that, i think you may be picky (not being rude)all cheap fleabay ones at 6-7$ usd and up ... MCU123 and morekingst prices seems okay cough for nowdslogic prices has risen a bitSaelae dont mention them, when you see a red version at 1400$ usd, something is not rightmany open projects on the web as not open as they should

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 03, 2023, 07:15:32 pm
content: I second the DSLogic (I have one, it's pretty good).We'd need to know what kind of specs the OP is after to otherwise suggest something workable.Just one general note - doing that yourself is going to be a rabbit hole, take up a lot more of your time and cost a lot more than you expect. Make sure it's worth saving a few tens of bucks while you're still going to have to buy stuff *and* spend hours developing that.These days, there may be a number of good reasons for making your own equipment, but saving money is rarely one of them.

author: Martinn
author_rank: Frequent Contributor
timestamp: July 04, 2023, 04:43:31 pm
content: Quote from: SiliconWizard on July 03, 2023, 07:15:32 pmQuote from: coromonadalix on July 03, 2023, 05:51:05 pmAbsolutely.The reason is I have a very specific use case in mind: Flood workplaces with cheap, mostly good enough logic analyzers/scopes. Rely on apprentice work and JLCPCB PCB assembly in case of DIY design.Do you know what is the best camera?Largest sensor, most megapixel, lowest noise, widest zoom range, best resolution?No.The best camera is the one you have with you.With this in mind, an OK logic analyzer with pedestrian analog - that you have right on your desk or in your home office - is better than a fancy MSO (we have plenty of those) or any other of the mentioned devices (we could purchase if we could justify its usage) somewhere in the storage or possibly lent out. For our usage, an 8 bit Saleae clone would be fine. So although I would prefer not to do that, buying 50 of those from China would solve the problem.However, even better would be some analog support. A few MHz would also be OK for many uses.Quote from: SiliconWizard on July 03, 2023, 07:15:32 pmFully agree. That's why the only way this design could be done (in our setup, effort being charged with hourly rates) is suggesting it as apprentice project. I imagine they could have fun doing it, learn something in the process and create value for the company. But this limits the complexity to very low levels. So FX3, FPGA, excessively modifying sigrok or completely writing a new software is out of the question.Quote from: coromonadalix on July 03, 2023, 05:51:05 pmYes and it seems only few options remain (thanks to all for your inputs!)There are no open source designs besides the original FX2 (well not open source, but simple enough) logic analyzer and sigrok. Sad to hear sigrok is getting stale.So unless one is either purchasing one of the many listed more expensive options (which is against the flooding idea), a $8 saleae clone or adding some simple analog (20 MS ADC with a few MHz input amplifier, potentially with isolation) is all that seems in reach.

author: artag
author_rank: Super Contributor
timestamp: July 04, 2023, 05:21:16 pm
content: You quickly run out of bandwidth on USB2. It's 480 Mb/s and typical cypress-based devices manage about 24MS/s. This is OK for an 8-bit logic analyser but a 20MS/s analog input would use it all up. This is why it's worth looking at USB 3.The reason Sigrok don't have an FX3 driver is that Cypress don't provide full details of the chip : you have to write your application inside an RTOS. As I understand it, this somehow prevents redistribution of code under GPL.FTDI have 16- and 32-bit FIFO interfaces to USB 3 in the FT600 series, which might avoid this issue. Dev boards are not ridiculously expensive.Andrew Zonenberg has oscilloscope software (glscopeclient) which is licensed under the BSD licence which may avoid the distribution problem. His software also allows for widening logic analysers by sampling a signal from more than one data capture device and synchronising the display of the data. However, my PC is too old / too poor graphics to run it.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 04, 2023, 09:26:57 pm
content: +1 for GlsScopeClient. Extra kudos for the GitHub workflow CI

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 04, 2023, 09:30:18 pm
content: Quote from: Martinn on July 04, 2023, 04:43:31 pmUnless this is directly your company's business, I fail to see why you'd want to do this.

author: thm_w
author_rank: Super Contributor
timestamp: July 05, 2023, 12:57:16 am
content: The LHT00SU1 (AXbee clone) should be decent, I've used a similar device before and it was useful for software debugging. If you want to buy a few of these and use them, to me its easily worth the $20.However, tacking on isolated ADC channels and multiple input ranges is a bit much to ask, unless you are very experienced on the software side.The clones have an 8-bit ADC, maybe that is the unidentified device on the board? There are some other clones that may be similar:https://www.aliexpress.us/item/2251832669290635.htmlhttps://www.aliexpress.us/item/2251832690215244.html(this one is claiming it can do 100V, maybe they just mean 10V with a 10:1 probe)If the basic AXbee clone is not enough for your use case, then buy the person the proper equipment (for USB dscope, hantek, or whatever, USB isolators, etc.). Its not going to be worth your time to redesign something better. Although it would be cool if someone did do it, admittedly.I think these guys posted here before:https://www.aliexpress.us/item/3256802565473922.html

author: Martinn
author_rank: Frequent Contributor
timestamp: July 05, 2023, 06:37:27 am
content: Quote from: SiliconWizard on July 04, 2023, 09:30:18 pmAssume you're working in home office and the device you are working on shows some slightly strange behaviour. You have to finish that report though, your scope is at work and you'll have a look at it on Thursday when you are back in the office. Of course Thursday many other tasks need to be done...I believe (and have experienced) in the benefits of low threshold offerings. Yes if it would have been a major bug, it would have been examined and fixed in the lab, but a minor glitch... might just slip through.To the idea of flooding: I once worked at a company where at the lab workplace the philips screwdrivers were always missing. Turned out the software guys needed those to screw in their custom PCI controller card into their PCs (and did not return them of course). So I went through software and ordered a screwdriver set for anyone who would not strongly object. Problem solved.This strategy works for items that are cheap compared to anyone's hourly rate. It does not for scope current probes or such.

author: Martinn
author_rank: Frequent Contributor
timestamp: July 05, 2023, 07:09:45 am
content: Quote from: thm_w on July 05, 2023, 12:57:16 amI have mentioned the LHT00SU1 above, see this link for some description:https://sigrok.org/wiki/Noname_LHT00SU1EDIT: Just added a picture of the PCB.On my board, the ADC is a MS5510 8 bit 20 MS/s from Hangzhou Ruimeng Techhttps://www.lcsc.com/brand-detail/1183.htmlhttps://www.lcsc.com/product-detail/Analog-To-Digital-Converters-ADCs_Hangzhou-Ruimeng-Tech-MS5510_C1509020.htmlQuote from: artag on July 04, 2023, 05:21:16 pmJust did a quick test with the LTH00SU1, pulseview runs at 12 MHz (crashes above) with eight digital and one analog channel. Signal is a 500 kHz sine (see screenshot).What route would you suggest going for USB3? Any chance at DIY?Quote from: thm_w on July 05, 2023, 12:57:16 amNice... anyone has experience with their software?EDIThttp://www.loto-ins.com/en/index.php?m=Article&a=show&id=25QuoteSounds a bit questionable. At least their latest PC software release is from 2.6.2023, while the lastest apk is one year old.Discussion on eevblog:https://www.eevblog.com/forum/testgear/how-to-promote-an-usb-oscilloscope-to-individual-engineers-i-am-the-loto-instru/Quote from: dobsonr741 on July 04, 2023, 09:26:57 pmVery interesting - thanks for mentioning! Seems like an analog-heavy sigrok alternative. Although currently (see chapter 5 - drivers - in manualhttps://www.antikernel.net/temp/glscopeclient-manual.pdf) seems to support mostly more expensive commercial scopes (Tek, Lecroy, Pico). I have to see how a DIY or cheap enough commercial device would fit in.

author: thm_w
author_rank: Super Contributor
timestamp: July 12, 2023, 11:29:55 pm
content: Here is one Voltlog just reviewed:https://www.activefirmwaretools.com/$250 though120MSPS digital, 0-20V 1MSPS ADC 12-bit, or 15-bit 200ksps, 2 3.3V low-res analog outputs.The hardware is not very expensive, the usual FX2, FPGA, and a PSOC MCU. Software wise however, incredibly complex.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 13, 2023, 01:47:27 am
content: Quote from: Martinn on June 30, 2023, 05:42:25 pmSure.The basic idea is sound, but for 30~50pcs, I'd look to create a base board as a carrier for existing FX2 module(s).That slashes your BOM and simplifies the design to protection/conditioning only.Those modules are cheaper than the FX2 is on the open market.A couple that catch my eye area) smallest with USB-Chttps://www.aliexpress.com/item/1005005680498612.htmlUS $4.29or USB-A and casehttps://www.aliexpress.com/item/1005005680615763.htmlUS $4.37b) Most pins, parallel - suit wider logic analyzers, and scopeshttps://www.aliexpress.com/item/1005003827454121.htmlUS $4.67Quote from: Martinn on June 30, 2023, 05:42:25 pmStart with the above and the software, and see what support there is for analog-path. Parallel ADCs are easy to add here, so you look for a supported one.I did see mention of one project that uses these modules for pulse-generation (ie test bench outputs rather than capture)

author: notsob
author_rank: Frequent Contributor
timestamp: July 13, 2023, 02:01:07 am
content: No exposure to this unit, may be worth a lookhttps://1bitsquared.com/products/bitmagic-basic

author: Martinn
author_rank: Frequent Contributor
timestamp: July 13, 2023, 07:06:36 am
content: Quote from: PCB.Wiz on July 13, 2023, 01:47:27 amInteresting thought... thanks!Quote from: notsob on July 13, 2023, 02:01:07 amNo analog, but at least a KiCad project as starting point!Quote from: thm_w on July 12, 2023, 11:29:55 pmNever seen this one before... interesting. Not too fancy analog front end though.

author: Nominal Animal
author_rank: Super Contributor
timestamp: July 13, 2023, 09:02:39 am
content: One thing I like about an isolated relatively high sample rate (say, 150kSps) 16-bit ADC for probing stuff on boards, is that I'd like to see therangeof voltages seen on that pin. My needs are limited to say 0-32V, so a 15-bit ADC would give a nice 1mV resolution even without a PGC.Instead of showing a single average voltage, a real-time histogram of the sampled voltage would be really useful, especially if it also shows the voltages at 2-4 highest spikes (ie., the prevalent voltages). While this can be done on an MCU, streaming the data to a computer over USB lets one develop new UIs for such a "voltmeter on steroids". For example, one might switch display modes on the UI to instead show the duty cycle, bias, min/max, rise/fall times if within the sampling rate, and so on.Combine this with a comparator (to programmatically select the high logic level) fed to MISO on a DMA-capable peripheral, and one could both measure and decode information on the same pin, in the same measurement...