Thread: How to decode a protocol like SPI by using MSO9104A?


Permlink Replies: 8 - Pages: 1 - Last Post: Jun 26, 2012 11:32 AM Last Post By: algoss Threads: [ Previous | Next ]
jenaflex

Posts: 4
Registered: 06/19/12
How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 20, 2012 11:55 AM
Click to report abuse...   Click to reply to this thread Reply
Hi, I am using MSO9104A. I want to decode a non-standard SPI protocol (like SPI, but not). There are MISO, MOSI and CLK (no Chip Select).

I tried 14-days SPI option trail. My settings are as follow:
4 wire SPI;
MISO - Channel 2
MOSI - Channel 3
CLK - Channel 1
Chip Select - Channel 4 (I tried ground it and set "active low"; also I tried give it 5V and set "active high")
Auto Setup;
Trigger: Serial: Channel 3 (I want to select CLK channel as Trigger, but the only options are channel MISO and MOSI.)
Trigger (another try): Edge: Channel 1 - CLK; falling;

others are default.

I always got the message - "can't decode. not enough edge."

I just need to figure out how to decode MOSI and MOSI based on the CLK.

For example, I can decode some by hand. When CLK is active, count the level of MISO such as "high low high low low low low low" (101010000)bin=(A0)hex. Then, convert 8 bit binary value to hex.

How to use agilent oscilloscope to do this?

Thanks a lot.
algoss


Posts: 371
Registered: 11/03/06
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 21, 2012 6:31 AM   in response to: jenaflex in response to: jenaflex
Click to report abuse...   Click to reply to this thread Reply
As far as I know, for 4 wire SPI, you need to have a real chip select (one that goes active and inactive), otherwise the decoder can't tell when the actual data transfer starts. I may be wrong, however.

Once you have chosen the channels correctly, if you have data running, then click 'Auto Setup'. The scope should figure out everything else out on its own, including timing, thresholds, etc. Have you tried that?

If it says you don't have enough edges, then either the depth isn't high enough, or the thresholds aren't set right.

Al
jenaflex

Posts: 4
Registered: 06/19/12
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 21, 2012 11:00 AM   in response to: algoss in response to: algoss
Click to report abuse...   Click to reply to this thread Reply
My device doesn't have chip select. There are a master device and a salve device. The electronic connections between them are just MISO, MOSI, CLK, VDD and GND. I tried use VDD as chip select(active high). It always says "can't perform serial decode; not enough edges". I have a couple times that the decode displays, but the result is wrong (the decode is not referring to the clock).

I am seeking a efficient and reliable way to decode the serial signal that is non-standard SPI.
algoss


Posts: 371
Registered: 11/03/06
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 21, 2012 12:18 PM   in response to: jenaflex in response to: jenaflex
Click to report abuse...   Click to reply to this thread Reply
Since you are using non-standard SPI it may not be possible to do what you want, but there is something you can try. If this doesn't work, there is no solution with this scope.

To do the following, you will need current scope SW, or at least version 3.20 or later. If you don't have that, you will need to update with SW from here: http://www.agilent.com/find/scope-apps-sw

You could think of your link as 2 2-wire SPI links, with separate clocks. Connect 2 channels to the clock line, 1 channel to MOSI and 1 channel to MISO. Now go through and set up each link separately. If it works, the you should end up with 2 SPI decode columns. The configuration for each direction, since a given channel can only be used once.

Good Luck.

Al
jenaflex

Posts: 4
Registered: 06/19/12
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 21, 2012 2:47 PM   in response to: algoss in response to: algoss
Click to report abuse...   Click to reply to this thread Reply
I tried 2 wire SPI, but I don't know how to set the clock timeout and word size. The default setting doesn't work(still cannot decode; not enough edges). When I change clock timeout to 13 us that is close to the period of clock and word size=8 (my serial communication is 8 bit), it seems shows the correct decode. However, how can I run two 2-wire-SPI decode to compare the MISO and MOSI?

Thanks a lot. You did awesome troubleshooting.

Edited by: jenaflex on Jun 21, 2012 2:53 PM
algoss


Posts: 371
Registered: 11/03/06
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 22, 2012 5:30 AM   in response to: jenaflex in response to: jenaflex
Click to report abuse...   Click to reply to this thread Reply
What version is your scope SW? If you're up to date (Version 3.50), then you should be able to independently decode and display 2 serial streams at the same time. I don't have access to a 9000 series scope, so I can't give you exact directions on how to do it.

Al
ksmith

Posts: 93
Registered: 08/06/09
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 22, 2012 8:26 PM   in response to: jenaflex in response to: jenaflex
Click to report abuse...   Click to reply to this thread Reply
Check out this video I made of doing exactly this:

http://www.youtube.com/watch?v=jiK6P7f1frU&sns=em

The error message you are getting is either as Al said, where the signals or thresholds are not set properly, or often you simply don't have enough data on screen; try going to a longer timebase.
jenaflex

Posts: 4
Registered: 06/19/12
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 26, 2012 9:22 AM   in response to: algoss in response to: algoss
Click to report abuse...   Click to reply to this thread Reply
my software revision is 02.00.0003
my firmware revision is Main 204 Trg 6.2 Ser 3.9.3

Now I just have 1 channel serial decode. 2 wire SPI works fine, but 4 wire doesn't.

Also I plan to read oscilloscope data via MATLAB. Does the software and firmware revision influence the result of my MATLAB script?
algoss


Posts: 371
Registered: 11/03/06
Re: How to decode a protocol like SPI by using MSO9104A?
Posted: Jun 26, 2012 11:32 AM   in response to: jenaflex in response to: jenaflex
Click to report abuse...   Click to reply to this thread Reply
my software revision is 02.00.0003

As I said in my post of 6/21, you need to have the newest SW, or pretty close to it. The current version is 3.50.something. It is available here: http://www.agilent.com/find/scope-apps-sw Once you have done that, you will be able to follow Kevin's instructions to get the decode. The update will take an hour or two, since you are so far behind. You will have to run a user calibration on it after doing the update.

First, before you load the latest firmware, you should connect it to the internet, and run Microsoft Update as many times as necessary, if you haven't done that in a while. Make sure you get all of the latest .NET patches. Remember, besides being a scope, it's a PC. If you don't have antivirus SW, you should install some. I recommend Microsoft Security Essentials (MSE). It's free and relatively low-load.

Now I just have 1 channel serial decode. 2 wire SPI works fine, but 4 wire doesn't.

You don't have a "true" 4-wire SPI, so as I said earlier, using the 4 wire decode doesn't and won't work. You need to treat it like 2 2-wire SPI links, that happen to share a clock. to do that, you need the newest SW, and you'll use 2 probes on the clock.

Also I plan to read oscilloscope data via MATLAB. Does the software and firmware revision influence the result of my MATLAB script?

In some cases, yes. While you are installing the newest SW, read the "ReadMe" document, that talks about the changes that have been added since you last updated. Then, look in the "Script and Programs" section for some pointers, including examples. If you post there, others will get the benefit of seeing the answers.

Al

Point your RSS reader here for a feed of the latest messages in all forums