S32K1 RTD function Lpspi_Ip_SyncTransmitHalfDuplex() clocks too many bytes

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

S32K1 RTD function Lpspi_Ip_SyncTransmitHalfDuplex() clocks too many bytes

跳至解决方案
1,378 次查看
hns80
Contributor V

When using the SPI in half duplex mode, the following call sends two bytes, which is expected:

Lpspi_Ip_SyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_BOARD_InitPeripherals, txBuffer, 2, LPSPI_IP_HALF_DUPLEX_TRANSMIT, timeOut);

When receiving, though, the function clocks multiple bytes. I tried specifying from 1 to 4 bytes and see the peripheral send enough clocks for 6 or 7 bytes:

Lpspi_Ip_SyncTransmitHalfDuplex(&Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_BOARD_InitPeripherals, rxBuffer, 1, LPSPI_IP_HALF_DUPLEX_RECEIVE, timeOut);

I see the same behavior whether I use interrupt driven SPI or polling.

How can I use the RTD calls to get the peripheral to receive a single byte with no extra clock pulses?

 

标签 (1)
标记 (3)
0 项奖励
1 解答
1,370 次查看
hns80
Contributor V

Changing SpiCsContinuous to FALSE fixed the problem

 

 

在原帖中查看解决方案

0 项奖励
1 回复
1,371 次查看
hns80
Contributor V

Changing SpiCsContinuous to FALSE fixed the problem

 

 

0 项奖励