Reading SPI Master Respose data in MPC5777M

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reading SPI Master Respose data in MPC5777M

751 Views
sandeepnagaraja
Contributor III

Hi All,   martinkovar

       As we are working on the SPI driver for MPC5777M, we could successfully transfer data and communicating with

the external peripherals, But i am not sure how does the slave send the response data to the master . Because in SPI protocol, the clock is controlled by master, for a successfull data transfer we need clock, as the clock doesnt have control over clock,

         (1) How will the slave SPI module sends the response to the Master SPI module.

         (2) Could anyone specify the steps to be taken while initiate the data transfer from slave to master.

Thanks & Regards

Sandeep Nagarajan

2 Replies

552 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Here you may see example code you could use as inspiration for your SPI drive development:

https://community.nxp.com/thread/381921

 

SPI works the way that during transfer from master to slave (clocked by master), slave sends data back to master (master exchanges data with slave). If master wants to read data, sends dummy word (in order to clock slave device) and receives data.

pastedImage_1.png

552 Views
sandeepnagaraja
Contributor III

davidtosenovjan

Thanks David, the article you shared explains exactly how slave response works. It worked with my code  too.

0 Kudos