S32k142 spi: LPSPI_DRV_MasterTransfer() problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32k142 spi: LPSPI_DRV_MasterTransfer() problem

ソリューションへジャンプ
2,289件の閲覧回数
nanjun
Contributor III

Hi,

The example lpspi_transfer_s32k142 works properly on the eval-board, where the slave transfers date to master by LPSPI_DRV_SlaveTransfer() and LPSPI_DRV_MasterTransferBlocking().

However, I exchanged the direction of data transfering and the master shall send the data to slave with the following lines:

masterDataSend = (uint8_t)adcRead;
LPSPI_DRV_MasterTransfer(SEND,&masterDataSend, &masterDataReceive, BUFFER_SIZE);
LPSPI_DRV_SlaveTransferBlocking(RECEIVE, &slaveDataSend, &slaveDataReceive, BUFFER_SIZE, TIMEOUT);
FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, 0U, FTM_PWM_UPDATE_IN_DUTY_CYCLE, slaveDataReceive<<8, 0U, true);

where slaveDataReceive is always 0.

Is there anything shall be reconfigured as well to make it operate properly?

Attached is the entire project. Thank you!

Kind regards,

Nanjun

 

 

 

0 件の賞賛
返信
1 解決策
2,277件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Nanjun,

This won't work, the SlaveTransfer must be ready before the Master starts the transfer.

danielmartynek_0-1635865837113.png

 

Regards,

Daniel

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
2,278件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Nanjun,

This won't work, the SlaveTransfer must be ready before the Master starts the transfer.

danielmartynek_0-1635865837113.png

 

Regards,

Daniel

0 件の賞賛
返信