S32K3_SPI_CS problem, when using GPIO to simulate CS

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

S32K3_SPI_CS problem, when using GPIO to simulate CS

跳至解决方案
889 次查看
wuxianlong
Contributor III

Hi, all

  When I used GPIO to simulate spi's CS, the data was wrong.Can you give me some help?
 

   In RTD2.0.0,  Lpspi_Ip_AsyncTransmit() calls Lpspi_TransmitTxInit() to initialize the transmission clock and reset. If the (CPOL = 1) mode is used, a low level pulse is generated each time on the SCK. If I use GPIO to simulate the CS pin of the chip, it will be interfered by this low pulse, resulting in abnormal data.

1.png2.png

BRs.

0 项奖励
1 解答
873 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @wuxianlong

As seen in the Lpspi_TransmitTxInit function, it is necessary to reset all the registers due to errata ERR050456. As you saw, this is generating the low pulse that is interfering.
What I suggest is that you modify this function and send the CS after the reset to ensure that does not interfere with the data.

 

B.R.

VaneB 

在原帖中查看解决方案

0 项奖励
3 回复数
874 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @wuxianlong

As seen in the Lpspi_TransmitTxInit function, it is necessary to reset all the registers due to errata ERR050456. As you saw, this is generating the low pulse that is interfering.
What I suggest is that you modify this function and send the CS after the reset to ensure that does not interfere with the data.

 

B.R.

VaneB 

0 项奖励
782 次查看
S3RD4R
Contributor I

 

I am also using GPIO to simulate CS. I am trying to communicate with an external flash which has a flow chart of:

1 - Write command

2 - Read response

during which CS should be low. However, it is impossible in this case since in second step inevitably an extra pulse will be sent. 

Is there any workaround for this case?

0 项奖励
101 次查看
NemoZhang
Contributor I

I'm facing the same problem as you. Could you please tell me how you managed to resolve it?

0 项奖励