Help Wanted: Open Source Oscilloscope On Rigol Hardware

We’ve often heard (and said) if you can’t hack it, you don’t own it. We noticed that [tmbinc] has issued a call for help on his latest project: developing new firmware and an FPGA configuration for the Rigol DS1054Z and similar scopes. It isn’t close to completion, but it isn’t a pipe dream either. [tmbinc] has successfully booted Linux.

There’s plenty left to do, though. He’s loading a boot loader via JTAG and booting Linux from the USB port. Clearly, you’d want to flash all that. Linux gives him use of the USB port, the LCD, the network jack, and the front panel LEDs and buttons. However, all of the actual scope electronics, the FPGA functions, and the communications between the processor and the FPGA are all forward work.

Why the Rigol? [tmbinc] says they are cheap, have decent hardware, and use parts that have accessible tool chains. Plus, the Rigol is popular among people likely to hack their scope. The Xilinx FPGA and the ARM processor are reasonably easy to work with using either open source or freely available tools.

We’ve seen several open scope designs, but developing from scratch is a different animal than reverse engineering something that is already built. We’ve also seen [Dave Jones] reverse engineer the DS1054Z in detail. We are sure that will be a big help to [tmbinc’s] efforts. We hope Hackaday readers will answer the call and help produce some open source software. It will be interesting to see if the community can outperform the manufacturer.


40 thoughts on “Help Wanted: Open Source Oscilloscope On Rigol Hardware

  1. I came here thinking “that sounds like a ridiculously overambitious idea that’ll never get anywhere” … and then I saw tmbinc is behind it. – I take it all back!

    1. This would benefit Supplyframe as well as hackers.
      Hmmm, on second thought what are the terms of use for the Rigol scopes? If a business funded a project that did not comply with those terms they could be held liable.

      1. Terms of use for a piece of gear? If I have bought it, I can do what I want. Supply correct power and switch it on – or tear it down or drop it and crush it. Everything without reading any kind of EULA.

      2. In most jurisdictions, terms of use – thankfully- are of no value without actually signing an agreement. You paid for the thing, so you should at least actually own it. Manufacturers changing ownership into a tentative form of renting is the scourge of our age.

  2. nice work, i’ve done the same for the DS2XXX blackfin one (uboot + kernel), if it is anything like the blackfin ones, rigol used to have a default RigolDsExe.ldr filename to execute from USB (instead of doing a fw upgrade) – might have something similar for the iMX.

  3. This is a great project. What is the analog front end?

    The biggest shortcoming (at least to me) is the 8 bit ADC used in most of these. Some of the low end scopes use an 800×480 display and double pixel sizes in software, which gives the blocky look. 10 or 12 bit would be great. A way to install a 7″ 1280×800 would be outstanding.

    1. With ADC sample rates getting pretty insane these days, you can easily increase the ENOB with oversampling on the FPGA. To get 10 effective bits from an 8-bit converter, you would need to oversample by (4^2) or 16x. Oversampling also increases SNR by 3dB for every effective bit added. I haven’t looked into the converters on these scopes, but I would assume that this is a common practice.

      1. Disclaimer: i do work for the Pico technology.
        Picoscope does offer upto 4 bits of enhancement through oversampling inputs. Certainly a trick the industry is very much aware of, though it’s an industry with quite a few hackers in it.
        Though when that’s just not good enough, we do have higher resolution devices

        1. How do they do it? Is it dithered? I can’t see how oversampling helps without a changing input. For a DC level, the reading won’t improve over 8 bits if the noise is low, will it?

          Also, at lower frequencies, isn’t oversampling the norm?

          1. Oversampling almost always helps improve the effective resolution of an ADC. Take a look at any high-end, high-speed converter and look at the dynamic nature of the least significant bits. This is not the reason you will find a dithering option in some high-end ADCs. The main reason for adding dithering to the front-end of an ADC has to do with the ability to spread spurious (periodic) signals out into the noise floor. This is obviously more useful when doing frequency analysis via FFT and you want to bury those pesky, low-level periodic signals hidden within your system so that they don’t ruin your nice, low-noise spectral display.

          2. I think maybe people are too loose with these sampling ideas. First, you need the right kind of noise and the right magnitude. For the statistics to apply, the noise has to be Gaussian and White. It also has to be the right size, and right size depends on the value of the signal you are trying to extract.

            Take for example a 1 volt ADC with 10 levels of quantization. A signal of 0.55V (say the voltage from a reference) will be in the center of a digitizer step. For oversampling to have any improvement, the noise has to be greater than 0.05V. If the signal of interest is 0.575, the value is at 3/4 of a step and the noise can cause transitions if it is only 0.025V in amplitude. It is my understanding that this is why dithering with a known function (or a true noise source) of a magnitude greater than 1 LSB can be used to increase precision.

            Oversampling will not help with a DC low noise source, and it also won’t help on low noise periodic signals with a good trigger. You are stuck with the resolution of your converter unless you introduce a noise source, or feedback, as in a Sigma-Delta configuration. At last, those are my thoughts off the top of my head.

            I’ll take a look at the Keysight video.

    1. Correct. There are open source scopes already. For example the Hantek DSO5072P. Hardware somewhere between a Rigol E- and Z-series, price half of the Z-series, software open source out of the box. No need to reverse-engineer anything.

  4. I may very well be speaking out of ignorance, but; kinda pointless isn’t it? A scope is just a standard diagnostic tool, I’d prefer to exploit it in order to innovate, rather than use up limited time resources to obsess over it. Of course, I’m not making an outright statement, just a thought.. maybe someone can explain why this is worthy of a skilled engineers time.

    1. What features do you wish your current scope had that it doesn’t? Go ahead and dream a little. I’ll wait.




      If it has everything you wish for, is it because you paid an arm and a leg? Or is it that you simply don’t need more features? <– pick two. If you paid an arm and a leg, you have fast and good. If you don't mind the lack of features, you have cheap and fast. This is for people that pick cheap and good, and are willing to put in the time to make their cheap hardware better.

      And to clarify, that's fast as in time get get the scope working, not fast acquisition rates; acquisition rates are a function of a scope's goodness.

    2. As an example I’d like to propose an LCR mode for the Z-S models which feeds a square wave to the DUT and computes the L-C-R characteristics of passive devices. It would require some auxiliary hardware, but is otherwise trivial. This is doable now using a laptop and existing software, but would be a nice builtin feature. There is much more than can be done with the hardware than the factory software provides..

      It is my firm hope the Rigol will publish the internal hardware API, at least when they EOL products. I’m fine with being able to use some binary blob library to implement custom features. It would make older gear very valuable as building blocks for custom instruments. Once you have some high performance ADC and DAC units under software control, there’s a lot that can be done very cheaply *if* you know how.

      Case in point, a compressive sampling (c.f. the work of David Donoho at Stanford) mode should increase the bandwidth and the sample duration by about a factor of 5. That’s a pretty big gain for writing software.

      The reason HP and Tek products have such high residual value is that you can get parts and everything else you need to repair 30-40 year and older instruments. Any company that follows that model will achieve great popularity. Buying a new, slightly better than required spec instrument gets much easier to sell to management if you can point to a good resale value on the instrument when it is disposed of.

      I have some nice instruments that are basically worthless because the data to repair them are not available. Which is a real shame for a 1 GHz RF millivoltmeter I have. Just not worth fixing without a published schematic.

      In closing, the value of this project is directly related to whether you have the chops to fix a scope. I’ve fixed two analog instruments and have yet to meet a computer I can’t beat into submission ;-)

      1. “The reason HP and Tek products have such high residual value is that you can get parts and everything else you need to repair 30-40 year and older instruments. Any company that follows that model will achieve great popularity. ”

        The last I heard (10/15 years ago) Caterpillar supplies parts for 40 years after manufacture.

    3. Actually a far more important reason for having source:

      I recently updated the firmware in my DS1102E. It just trashed a USB drive with data I did NOT want to lose. I *really* don’t appreciate that trick! Apparently it formatted the USB drive before writing a waveform to it *very* slowly. Worse, I could find no way to unmount the USB drive. So Windows now says it is corrupted. So I can’t even get the data that trashed my data!

    4. One thing that came on my mind – if you look at Ben Krasnow’s electron scanning microscope (the one he got used, not the one he scratch built :D), he was using a fancy scope to capture raw data from the video signal output and then processed it on a PC to get images.
      Any kind of work like this will involve shuffling the USB drive between a PC and the scope, which I think is rather silly in this day and age. So why not connect a USB ethernet NIC? You could then even control the scope from the PC if *someone* writes the software package. Automated measurements over long periods of time and all that… definitely can’t do that with the scope out of the box, hack needed.

  5. Wouldn’t it be possible to just add new features with a mechanism like CHDK ? Because for writing a new firmware from scratch you will need A LOT of time and even more motivation (and skills). The chances a big that such a project will die even before the CURRENT functionality of the scope has been duplicated/implemented…
    I don’t see the point of making an entire new and open source firmware for a scope except for adding new features, but maybe this is possible with a lot less work.

    1. where is this edit-button?

      I just thougt, you can download the firmware from Rigol directly, so “just” reverse-engineer and hack it (for new features) and flash it to the scope. Yes, legal problems, i know… :-(

  6. Just in case someone from Rigol reads this thread.

    If the hardware interface API were documented and published, then the barrier to innovative new features would be greatly reduced. There are official Rigol features and there are user contributed features which can safely be installed. I’m assuming no deliberate malware, just separate address regions for Rigol & user programs in flash so it’s easy to revert to factory.

    A good bit of this appears to be available, but challenging to access.

    The DS1xxxD/E series are nearing EOL commercially relative to the Z series and competition. Releasing the hardware BIOS source under copyright as documentation the way IBM did with their PC, would raise the resale value of the older line, making an upgrade more attractive to owners of the previous models. In all fairness, given BIOS documentation for my DS1102E, I’d keep it to use for specialty projects where I needed high performance ADC.

  7. FYI, I’m about to launch a crowdsupply campaign for a new scope:

    It’s 4-channels, 125 MSPS, 8 bit, ~100 MHz BW.
    The goal was to keep the cost as low as possible (with those specs). It should retail for < $100.

    It's completely open-hardware and open-source, including firmware and software. Hack away!

    It's also designed to be expandable – just connect 2 (or more) of them together to get 8, 12, … channels, etc. A trigger in any channel can trigger the readout of all the boards, within ~1 clock tick (20 ns). I think that's actually a pretty unique feature.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.