Reading SPI Master Respose data in MPC5777M

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Reading SPI Master Respose data in MPC5777M

753 次查看
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 回复数

554 次查看
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

554 次查看
sandeepnagaraja
Contributor III

davidtosenovjan

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

0 项奖励