Jump to content
43oh

Understanding SPI read from slave


Recommended Posts

Hi Folks

 

Ive recently started looking at using the F2802x SPI. For my application I would like to be able to communicate between two F2802x devices a string of 8-bit chars of arbitrary length (+using FIFOs), and I have a few questions.

 

The slave device is able to request read service from the master by means of a GPIO line to the master that the master has configured as an external interrupt.

 

The thing is I am not understanding the steps required for the master to begin a read from the slave.... I checked out the data transfer example (sect 1.5.5) in the SPI ref guide (SPRUG71B) but TBH I didn't really understand what it was trying to convey...

 

I guess the master needs to transmit dummy bytes for every byte that it wants to receive, is that right?

But how should the master "know" how many bytes that should be? Maybe it just keeps going until the slave clears the TALK bit?

 

Thanks

Link to post
Share on other sites

Toby

 

I will try to help.

Im no pro at this, although I have used the SPI peripheral successfully.

 

"I guess the master needs to transmit dummy bytes for every byte that it wants to receive, is that right?"

 

Yes thats right

 

"But how should the master "know" how many bytes that should be? Maybe it just keeps going until the slave clears the TALK bit?"

 

Thats your job to establish in software, maybe the last byte of your transmission from the slave could be 0x00 and

in your masters Rx_Isr have it look for that to end the transmission.

Just a thought.

 

good luck

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...