Jump to content
  • 0

Kirsan

Question

Hi forum users. Please tell me, is it possible using an analog discovery 2/3, using the "protocol" tool to implement the following behavior of the SPI?

519197907_.png.33ca471d74f8fa89bcce106a9279a07f.png
1977716787_.png.deecda4260c0ce36816e03e8410e460b.png

 

I'm trying to figure it out, but as far as I can see, the transmission of the "read/write" event is different from what I would like to receive.

.thumb.png.635329b498d347c2187aa9b413c2c7e6.png

Edited by Kirsan
Add tags
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @Kirsan,

I'm a little confused by what you are wanting to reproduce.

Regarding your initial two images of SPI sequences, are you wanting to generate both MOSI lines simultaneously through the Protocol instrument?

Or are you instead showing two separate sequences, with the parent device first sending a 15 bit write command to some address followed by 8 bits of data, and then verifying the information by having the parent send a 15 bit read command to which the child responds with the 8 bits of data?

The Read Write mode within the Master tab as well as the ReadWrite function within the Custom tab is using the full duplex feature of SPI where it both reads and writes data simultaneously.

If you are sending both a write command followed by a read command to the child device, it will depend if the child device requires the chip select line to be pulsed before the two separate commands can be sent; if it does need this, you'll likely need to use the Custom tab with the Start, Stop, and various Write and Read commands. There are a number of examples within the Example dropdown under the Custom tab that show how this might be done.

I do not believe there is a way to use the ReadWrite mode to write some data and listen for an additional number of bytes (unless you added additional dummy words to the "Write (DQ0)" line that you knew that the child device would not respond to or attempt to interpret once it had received a Read request).

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi @JColvin

Thank you for the answer.

Sorry, it was necessary to describe my question in more detail.

I'm trying to figure out if it's possible to form a bit that tells the slave that this will be a "read\write procedure" command.

As far as I can see, if I run the "read" command from the "protocol-spi" tool, then the AD3 will first transfer the data (I sent a some device address). Then the AD3 moves the MOSI line to the high level. What is the "read procedure" indicator for the slave device.

927898451_.png.553495278559ca0c529ab9ce05e415a1.thumb.png.cc2b557c36765963a8458c9ead6d1784.png

But, the device I'm trying to communicate with via the SPI protocol uses the first bit in the message as the "read/write procedure" indicator.

Read(high level on MOSI line):

519197907_.png.33ca471d74f8fa89bcce106a9279a07f.png.99ce307018f090031e8b70ee7312e9b7.png

Write(low level on MOSI line):

1977716787_.png.deecda4260c0ce36816e03e8410e460b.png.576da82cace358d8f8bc5c3506f80840.png

 

At the moment, I found a way out in that I transfer the address not 0x0038, but 0x8038. That imitates the desired pattern of behavior. For some reason, I didn't think about it from the beginning.

Link to comment
Share on other sites

  • 0

Hi @attila

Thank you for the answer.

Yes, for the now this scheme work for my situation.

Is it possible that in some future releases of the WaveForms, you will be able to add a similar behavior(as some option or few options) of the SPI for read and write modes?

553324412_.png.369a20b158d7519d73d471266865f586.png

170957277_.png.8b43a7984837f2a11b377d475e2f4397.png

 

Link to comment
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
×
×
  • Create New...