Oscilloscope or Logic analyzer?

Hi,
I was looking for a way to debug sFOC and EFeru hardware with an oscilloscope, but it only has two channels.
Now I stumbled over an 8-channel logic-analyzer which says it’s saleae-compatible. (whatever that means)

Will it help debugging or is it a waste of money?

What do you want to debug ?

I couldn’t get the debug channel on the hoverboard controller to work.
I also want to check PWM and hall sensors.

Most stuff is digital and comms…then there’s the boost-generator stuff I want to explore.
Also a good clamp-multimeter is on the way for higher amps and voltages.

For the debug channel in Eferu, as mentioned on the wiki, if it’s not working with one sensor cable, configure the debug on the other side and try again, to make sure it’s not a hardware issue.

For visualizing the current waveform or hall sensor state, you can use this.

For visiualizing the PWM I am using an oscilloscope.

A logic analyser is certainly a useful tool…

1 Like

Are you sure it’s saleae compatible? That is a pretty premium hardware, and I don’t think their software is compatible with any third-party things AFAIK.

There is an open source sigrok which there are many cheap digital logic analyzers available online for even as low as $5. Logic analyzers are a good tool but using them properly can be tricky.

To be honest, there is more value in getting a good programmer, like an STlink or Jlink and doing debugging over JTAG/ SWD, if you already have an oscilloscope for all the analog things.

So many options, there’s the right tool for every problem.
I was surprised that eferu doesn’t use the ST-Link in the first place?
But what about other MCUs like rp2040 or esp32? Do they all offer sw-debug ports?

What do you mean by using the stlink?

Yes, the rp2040 supports debugging, it has some kind of port to basically read the whole state of the system without interfering with program execution, a high speed. You can actually use another pico to interface to the first one, something called pico-probe. I was never clear on the details because it only really works with C++ and I use micropython. In micropython you don’t really need debugging because of the interactive nature. I can put a break point in the program and then read out whatever I want, execute any function, do whatever I want. It’s not necessarily better, but that’s why micropython doesn’t really have a debugger. It would still be nice imo, but the pressure to develop it was never really there.

Edit: I just realized this not a mere historical footnote, this could be inherited by the lepton 3.0, I should simply poke around with an oscilloscope but I’d have to set everything up again and I don’t have time…

1 Like

I had to buy an ST-link to flash firmware thru the SWD-port. So it’s already there.
But I guess it doesn’t transport the eferu-debug data? I only had the option to pick COM2 or 3…

Just saw the Pico has the same SWD-port as other STM32 chips. Could I use the ST-link to debug, like @Candas1 described in his linked thread (ST-viewer)?

stviewer may only work with STM32 chips (and alike, e.g. GD32). I’m not sure if it’s expecting certain registers at certain addresses.
You can use the STLINK or any other SWD debugger on the rp2040 with swd pins, but I think if you want to debug both cores at once you need to use the pico-probe, which is also pretty cheap.

This depends on how the eferu project is set up, you can always use SWD to look at specific memory areas if the pins are available. However in many cases it’s more convenient and user friendly just to dump debug info to a serial port, which doesn’t require any special tools to read, which is probably why they choose that, but it’s not in place of a SWD/JTAG device, just in addition.

A Saleae-compatible logic analyzer costs less than $10 and can use the open source Sigrok program. Anyone working with microprocessors and logic levels should have one “just in case”. For $10, there isn’t any other tool that offers as much. It’s also relatively easy to learn, with literally thousands of tutorials. I can understand thinking about buying a decent oscilloscope (at least $200) for a hobbyist, but a logic analyzer is a no-brainer imho. It’s not a replacement for an oscilloscope, but can do things almost impossible to do with an oscilloscope (like capturing an EEPROM SPI traffic and decoding it by stacking the Sigrok decoders)

The original 8 channel, 24MHz Saleae was based on a Cypress CY7C68013A chip Saleae Logic - sigrok programmed with custom USB ID. Unsurprisingly, it got cloned right away and the cloned copies are as functional as the expensive Saleae for a fraction of the cost. The value Saleae offers is in the software. While it is possible to run the original Saleae code on the clones, it’s better to use Sigrok and not violate Saleae’s IP.

Saleae stopped selling the original 8 ch, 24MHz devices years ago, and now only offers much more expensive ones.

Next step up would be a DSLogic DreamSourceLab DSLogic Plus - sigrok, for slightly more than $100. It’s a significantly better device (16 channels, 400MHz sampling, better front end for various logic levels), but for most 3.3V-5V uses, a Saleae clone offers 95% of the functionality for less than 10% of the cost.

A debugger like STLink (also <$10) is another no-brainer. But for me at least, debugger and logic analyzers are complementary, and one needs both.

1 Like

I like my DSLogic :slight_smile: I’d recommend it.

Current Salae software won’t work with the $10 clones in my experience… but Sigrok/PulseView works fine with them.

The $10 ones are so cheap they’re kind of a no-brainer. But they’re also quite limited. The 24MHz applies to a single channel, so if you want to peek in on SPI, for example, you need 4 signal lines and it won’t do more than 6MHz. So that’s already a bit slow unless you set your SPI speeds quite low… but for watching motor PWMs it’s plenty fast enough :slight_smile:

2 Likes

Thanks for pointing me to the sigrok pages. The 8-channel/ 24MHz is the one I have ordered.
The seller stressed out to be 100% saleae compatible, but it’s good to know there’s an alternative.

Just in case anyone else finds this thread… THose way-cheap “100% saleae compatible” logic analisers really do work. Download the software from the Saleae website and it works as well on the cheap clone as the $$$$ name brand unit. I can’t see how anyone can woork without a logic analyzer. These things will record the PWM lines and show you the data in a serial line. (Just TRY and analize th signal in a I2C data link with your o-scope)

The Saleae software is proprietary and the reason why Saleae HW costs so much: because they invest in the software.

When using a clone, I prefer using Sigrok Pulseview. It has the same functionality, works well with the Saleae clones, and once you learn it, it also works for other logic analyzers. For example, the DSLogic family of logic analyzers, one of the best values in logic analyzers, uses a slightly customized version of Sigrok Pulseview

There’s no reason to suggest pirating software when there are equally good open source alternatives (stepping off my soapbox now :slight_smile: )

If you like the cheapo analyser, you’ll like a real one even better :smiley:

The cheap ones can do the motor PWM, no problem, and also I2C. But the SPI protocol used by our sensors, you already have to slow them to down to be able to catch it with the cheap LAs.

Spending on the Salae or DSLogic models will let you trace a lot faster signals, quite apart from possible moral questions around using their software.