S32K312 - SPI Clock, MOSI make wrong pulse

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

S32K312 - SPI Clock, MOSI make wrong pulse

跳至解决方案
439 次查看
ssean
Contributor II

Hello.

When I send data to MOSI by called Spi_SyncTansmit(), SCK and MOSI make wrong pulse at start.

It happen only in use CPOL=1(Clock Idle HIGH, Active LOW).

If I set CPOL=0 (Clock Idle Low, Active HIGH), it is okay.

* RTD Version 2.0.1 (7, July, 2022)

 

1. Send 0x00 00

0x0000.jpeg

2. Send 0x07 31

0x0731.jpeg

3. LPSPI_1 Register value

LPSPI_1.jpeg

 

Best Regards,

Sean Sung

0 项奖励
回复
1 解答
405 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Dear @ssean,

The issue is that the Lpspi_Ip_SyncTransmit() resets the LPSPI module in function Lpspi_TransmitTxInit().

You would need to remove the code that reset the LPSPI from the function.

 

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
421 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ssean,

It was discussed here:

https://community.nxp.com/t5/S32K/S32K3-SPI-CS-problem-when-using-GPIO-to-simulate-CS/td-p/1564367

The module is reset at the beginning of each transfer.

Normally, with your configuration OUTCFG = 0, the MOSI line should retains last value when chip select is negated (beetween transfers).

But the module is reset in the driver.


Regards,

Daniel

0 项奖励
回复
410 次查看
ssean
Contributor II

Dear @danielmartynek 

Thank you for reply.

It happen with OUTCFG=1, too.

Can you give me advise for how can I fix this problem?

 

Best Regards,

SEAN SUNG

 

0 项奖励
回复
406 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Dear @ssean,

The issue is that the Lpspi_Ip_SyncTransmit() resets the LPSPI module in function Lpspi_TransmitTxInit().

You would need to remove the code that reset the LPSPI from the function.

 

Regards,

Daniel

0 项奖励
回复
348 次查看
ssean
Contributor II

Dear @danielmartynek 

 

I fix this issue to CS control by peripheral engine (not GPIO).

 

Thank you for reply.

0 项奖励
回复