Author Topic: Logic Analyzer from one channel of your Rigol DS1052E  (Read 2381 times)

0 Members and 1 Guest are viewing this topic.

Offline pyroespTopic starter

  • Regular Contributor
  • *
  • Posts: 180
  • Country: be
    • Nicolas Electronics
Logic Analyzer from one channel of your Rigol DS1052E
« on: December 12, 2013, 10:04:16 pm »
Hello everyone,

I needed a logic analyzer to check a couple of digital I/Os. I don't have one of those fancy €300+ logic analyzers and thought of a way to make one, using the DS1052E.
Obviously, I wasn't the first one to think about this idea.
http://codeandlife.com/2012/05/16/worlds-simplest-logic-analyzer-for-5/

So what you do is a simple buffer and R-2R network to mix the digital I/Os into one single analog signal. Measure the analog signal and stop the oscilloscope when you think you have enough data. Then you simply have to convert the voltages to PCM values.

I've done this for the Rigol DS1052E oscilloscope that uses the 1MB of samples, a bit of calculation and some edge detection.
The program reads the data from the scope and writes a file that can be opened in OLS (open logic sniffer) software.
http://www.lxtreme.nl/ols/

As an example, I tested this with a simple 4 bit counter. It looks like this:
- Analog signal


- OLS


How to use:
First thing you have to do is install the National Instrument NI-VISA 4.6.2. I don't know if a higher/lower version would work with this. You'll have to experiment with it.
Then connect the scope through USB to your PC.
Quick search through the forum can give you a couple of results about how to install the NI-VISA software and scope on the PC.

- Rigol DS1052:
Enable/Set long memory. Use only channel 1 (disable everything else).
Capture and stop the scope, before launching the program.

- PC:
Run cmd, go to folder containing the exe, run the following command:
program_name.exe -channels <uint> -mask <uint> -Vref <float>

Channels : number of I/Os you want to debug (for my little test, this was set to 4)
Mask : This an OLS data, set it to "2^channels - 1" to see all channels, unless you want to mask some out.
Vref : Is optional, set to 5V (default)

Program license: http://creativecommons.org/licenses/by-nc/4.0/

The source code is included so you can play with it if you want to.
No error detection has been programmed, I couldn't be bothered with it.
The edge detection is done with a crappy triangle window, Gaussion window would have been better.

Hope this can help some of you.
If you have any problems with it, let me know.

- pyroesp

PS: There are 2 defines in the code that determine the edge detection. I forgot to add them as an argument when running the program.
The precision define, sets the window width, and then there's a threshold.
You'll have to change those and compile if you want something else than what I set.
« Last Edit: December 12, 2013, 10:06:18 pm by pyroesp »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Logic Analyzer from one channel of your Rigol DS1052E
« Reply #1 on: December 13, 2013, 12:27:26 am »
Get one of those clone logic analyzers from ebay - <$20.
================================
https://dannyelectronics.wordpress.com/
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28780
  • Country: nl
    • NCT Developments
Re: Logic Analyzer from one channel of your Rigol DS1052E
« Reply #2 on: December 13, 2013, 01:51:59 am »
Many many years (decades!) ago you had oscilloscope multiplexers to have more traces on an oscilloscope. The basic idea is that you multiplex a couple of inputs into one channel while giving each input a different offset.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf