Lpspi half duplex configuration for S32K312EVB-Q172

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

Lpspi half duplex configuration for S32K312EVB-Q172

167 次查看
MOMO6389
Contributor I

Hello everyone,

I am a first time user of S32K312 and am not familiar with the S32DS development environment, so I would like to get some help.

I want to communicate with LPSPI2 using PTB2(SIN) and PTB29(SCK) pins. (PSC pin is not used.)
And, I want to transmit multiple bytes of 8-bit data continuously using Lpspi_Ip_AsyncTransmitHalfDuplex().
Sometimes I only transmit, and sometimes I transmit and receive continuously.

1. How do I set it up using S32DS3.5 and SDK?
2. When transmitting multiple bytes with SPI, how do I output continuously without latency between bytes?
3. How do I do SPI Rx(DMA) after SPI Tx(DMA)?

0 项奖励
回复
4 回复数

115 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @MOMO6389,

Refer to this RTD 3.0.0 example: https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-SPI-Transmit-amp-Receive-Using-DMA-...

You need to change it from full-duplex to half-duplex and reconfigure the ports.

 

Regards,

Daniel

0 项奖励
回复

75 次查看
MOMO6389
Contributor I
@Daniel

First, set the two pins SPI_CLK and SPI_SIN(or SOUT) to use half-duplex.

Then, how do I use SPI to send data in transmitter mode (Controllr Tx DMA) and then change to receiver mode (Peripheral Rx DMA) to receive data?

Thanks.
0 项奖励
回复

40 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

HI @MOMO6389,

The DMA configuration is the same as in the full-duplex mode.

It uses the same registers, flags etc.

And it is all managed by the driver.

So, if you call the transmit function, the LPSPI TX DMA channel is used to transfer the data.

 

 

 

0 项奖励
回复

137 次查看
MOMO6389
Contributor I
* Test HW: S32K3X2EVB-Q172
* MCU: S32K312
* Compiler: S32DS3.5
* SDK release: PlatformSDK_S32K3_S32K312_M7
0 项奖励
回复