Author Topic: DS1000Z series serial decode  (Read 19773 times)

0 Members and 1 Guest are viewing this topic.

Offline biot

  • Regular Contributor
  • *
  • Posts: 70
Re: DS1000Z series serial decode
« Reply #25 on: October 25, 2014, 06:25:41 pm »
Does the serial decode also support 9-bit data protocols? (e.g. Multi-Drop Bus protocol used in vending machines).
There isn't a single "serial decode", covering all variants of such a broad term.

Captured logic data gets fed into a python script of your choosing, which then decodes it and outputs annotations and/or binary output of the payload and/or python objects to pass on to decoders that can further decode this payload (as in the I2C/XFP example).

The number of bits in the protocol has nothing to do with it.

Take a look at the source of the I2C protocol decoder. It handles only I2C: takes two logic signals (SCL and SDA) as input, and outputs 11 types of annotations, 4 types or binary payload, and Python objects for other decoders up the stack.

 

Offline pascal_sweden

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: no
Re: DS1000Z series serial decode
« Reply #26 on: October 25, 2014, 09:59:17 pm »
I was refering to the "serial decode" option on the Rigol DS1000/2000A series.
 

Offline ThomasDK

  • Regular Contributor
  • *
  • Posts: 139
  • Country: dk
  • B.Eng. EE
Re: DS1000Z series serial decode
« Reply #27 on: April 04, 2015, 05:09:15 pm »
Digging up an old thread, but just did an I2C decode from a Rigol DS1102E with sigrok, and thought I would add a little guide ;)

As sigrok doesn't understand the Rigol csv format, I translated it with Matlab.

Step by step:

1. Save csv from scope

2. Import column 2 and 3 in Matlab.
These are the actual data, the first column just contains timestamps.
The data is voltage readings and sigrok expects 1's and 0's. Let's fix that:

Code: [Select]
CH1(CH1<1)=0
CH1(CH1>0.99)=1
CH2(CH2<1)=0
CH2(CH2>0.99)=1

This will translate all readings under 1V to a '0', and all other to a '1'.

3. Create a matrix with the two columns.
In this step it is important to put them in the right order. You want the Clock as the first column, and Data in the second.

Code: [Select]
data = [CH1, CH2]

Switch CH1 and CH2 as appropriate, I had the clock on CH1.

4. Save the matrix as a new csv file
Code: [Select]
csvwrite('i2cdata.csv',data)

Now we have a file, that sigrok will read :)

5. Apply magic. (sigrok)
Copy the generated csv file to your sigrok-cli folder.
Next, open "sigrok command-line tool", and type the following:

Code: [Select]
sigrok-cli.exe -I csv:samplerate=1000000 -i i2cdata.csv -P i2c > i2cdata.txt

That's it! i2cdata.txt now contains the decoded data.

/Thomas
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf