S32K144 spi

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144 spi

3,046 Views
yinzc
Contributor I

Hi,what the maximum data length transmitted at one time?I try to transmit 72 bits but only 32 bits transmitted.

0 Kudos
Reply
12 Replies

2,985 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@yinzc

1.

Senlent_0-1665469709710.png

2.

Senlent_1-1665469770233.png

3.the blue one is LPSPI1_PCS3 and the yellow one is LPSPI1_SOUT.

Senlent_2-1665469815262.png

note,here i did not observe the waveform of LPSPI1_SIN,because there is no slave device on my side,so i am not sure what i configured is correct,you can test is with your slave device.

 

0 Kudos
Reply

2,960 Views
yinzc
Contributor I

Hi,i am trying to send 40bits data whitch is 25ms cyclic.

The first group of data is shown followin

scope_38.bmp

The second group of data is shown followin

scope_39.bmp

The third group of data is shown followin\

scope_41.bmp

The first two groups are both normal. The third group is a little abnormal. After the third group sends, both the chip selection and the clock are pulled down. They should be pulled up normally and no data is sent after three times.

Can you help me solve this problem?

Best regards

Thanks

 

 

 

0 Kudos
Reply

2,955 Views
Senlent
NXP TechSupport
NXP TechSupport

你自己先找下原因,监控下Status Register (SR) 看看有什么异常,不接slave device会不会这样,可以改一下我提供的示例代码,将收发单独分开来(先都发完再读FIFO),然后再测一下,还有会不会是slave device的特性,自己拉低了总线,

0 Kudos
Reply

2,948 Views
yinzc
Contributor I

你好,是SR寄存器的MBF置位了,我现在用的是SPI1,我用相同的配置配置SPI0,数据能正常循环发送,请问这是什么原因呢

0 Kudos
Reply

2,945 Views
Senlent
NXP TechSupport
NXP TechSupport

会不会你的两个模块的设置上存在差异,SR的其它只有MBF异常吗?FIFO overflow可能也会导致MBF异常,速度再降一下,你先排查一下吧,下周问题没头绪,再讨论吧

0 Kudos
Reply

2,979 Views
yinzc
Contributor I

Thanks Senlent,It helps me a lot.

0 Kudos
Reply

3,026 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@yinzc

       The TX FIFO for each spi instance has 4 words, one word size = 32 bits. The length of TDR is 32 bits, and the data written to the FIFO is 32 bits each time.(TDR:Transmit Data Register).

0 Kudos
Reply

3,023 Views
yinzc
Contributor I

Hi,Senlent.

Thank you for your reply,how to write register if i want to transmit a 72 bits data? 

0 Kudos
Reply

3,020 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@yinzc

Can you tell me which IDE and library you are using?  or you can send me your demo code.

     

0 Kudos
Reply

3,016 Views
yinzc
Contributor I

Hello, i'm using S32 Design Studio for ARM Version 2018.R1 and the demo is  'LPSPI_s32k144'.

Please see the following pic.

yinzc_0-1665390169468.png

 

0 Kudos
Reply

3,010 Views
Senlent
NXP TechSupport
NXP TechSupport

thank you, and  I need  some time to finish this demo.

0 Kudos
Reply

2,991 Views
yinzc
Contributor I

Thanks.

I'm looking forward to your reply.

 

0 Kudos
Reply