• 0
vinodcxlv

Controlling a DAC with SPI Protocol Analyzer

Question

Hello,

What is the difference between the "custom" and "sensor" tabs on the Protocol Analyzer in Waveforms? Are they used together? Where the custom tab gives the user the ability to write their own custom SPI Protocol and use it in the Sensor tab? And can I use them to develop a script that would control an SPI compatible 12-bit DAC. The goal is to read the 12 bit digital data from a file, with data ranging from 0x0000 to 0xFFFF (16 bits technically since the 2 MSB determine the DAC Power Modes and the 2 LSB are don't cares) and outputting that data from the Analog Discovery 2 to the 12-bit DAC

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @vinodcxlv

The 'sensor' tab is for sensors, ADCs. The timing of the loop function is precise, given by the device and it is identical in each cycle. The software reads the response of the devices.

You can use the 'custom' tab or the Script tool to read the file and send it over SPI.
See the examples and Help tab.

image.thumb.png.cb312ec18c6be30325736a12943ca3d5.png

image.png.5b718bcdc30fa1dad49acefbf93ebaa7.png

Share this post


Link to post
Share on other sites
  • 0
18 hours ago, attila said:

Hi @vinodcxlv

The 'sensor' tab is for sensors, ADCs. The timing of the loop function is precise, given by the device and it is identical in each cycle. The software reads the response of the devices.

You can use the 'custom' tab or the Script tool to read the file and send it over SPI.
See the examples and Help tab.

image.thumb.png.cb312ec18c6be30325736a12943ca3d5.png

image.png.5b718bcdc30fa1dad49acefbf93ebaa7.png

Thank you for the feedback. To read the file in the custom tab would I just need to comment rgData variable and provide the path? Does the file need to be JSON or can I just have my configurations (clock, select and data) in a text file?

Share this post


Link to post
Share on other sites
  • 0

Hi @vinodcxlv

You have functions to read data from binary and text file, see the examples and Help tab.
The Script tool supports JSON if you want to use it, but it does not apply settings from such data.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now