VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

API to decode SPI/I2C on the MSO?

I've had my VirtualBench since August and up till now it has simply served as a low end desktop scope. Now that the SPI (and I2C) decode option has been implemented in the scope, I am using it to debug a custom MCU application where the MCU is communicating with other devices over SPI. The SPI packets are being sent ~10ms apart and there are ~200 of them that I need to ensure are getting there in the appropriate order. I was hoping to capture a large portion of data and export this to csv and be able to read the decoded values but alas, the exported csv appears to be downsampled and completely useless, the SPI data is completely invalid in the CSV. I know the sample rate is good enough as I can zoom in on a single sweep acquired waveform and the SPI data is correct when I zoom in. Also, if I zoom in, I can export csv data and the SPI is correct, unfortunately I only get the SPI data which is visible on the screen, not the entire buffer.

 

Assuming this to be a GUI bug, I thought, I'd just scrap the GUI and go to the API but, alas, there is no MSO SPI decode API as of yet. Can someone point me in the direction of the SPI MSO decode API (if it exists) or at least confirm that the VirtualBench cannot currently do what I wish to do?

 

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 1 of 5
(6,210 Views)

The behavior you are seeing is expected, although is not always desirable. For the MSO, data export only exports the data on-screen, but as you've noticed that doesn't give you the results you want when it comes to bus transactions. We already have a bug filed about this behavior (CAR 518953).

 

There is no bus decode in the VirtualBench API; this is an application feature, not an API feature. From the VirtualBench API your only option would be to parse the SPI transactions from the digital data returned from MSO Read yourself.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 2 of 5
(6,184 Views)

Is there any chance of getting the decode on the scope API? It seems silly for a software based scoped to not have an API into parts like decoding of signals. Another feature request would be a table display when doing serial debug.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 3 of 5
(6,158 Views)

I've filed both as feature requests.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 5
(6,110 Views)

I had some time recently and created a VI that can be attached to the NI VB MSO Read output and decode SPI data. Please note it is not 100% tested.

https://decibel.ni.com/content/docs/DOC-44304

 

I hope it helps 🙂

Marton

0 Kudos
Message 5 of 5
(5,382 Views)