SPI setup question

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

SPI setup question

跳至解决方案
2,234 次查看
kimdukyu
Contributor II

I have a question regarding the NXP MCU (MPC5746C).

My current development environment is as follows.

        1. AP : SA6155P(Qualcomm)

        2. MCU : MPC5746C_176 176-pins LQFP176

 

It communicates between AP and MCU through SPI interface. Regarding SPI, clock and SPI pin settings were set based on the following.

kimdukyu_0-1665050842133.png

Set the two clocks BUS_CLK and BAUD_CLK required for SPI operation and set as the figure below in S32DS IDE as slave mode (Mode4 cpol=1, cpha=1).

kimdukyu_1-1665050893993.png

In case of setting as above, S PI communication proceeds without any problem at 1MHz.

kimdukyu_2-1665050942438.png

- 1) Yellow : Clock
- 2) Blue: MISO
- 3) Red: MOSI
- 4) Green: CS

However, at 5MHz, the AP sends clock, CS, and data, but the MCU cannot receive data.

kimdukyu_3-1665050992876.png

Even though the clock and CS data lines are normal as in the scope waveform above, the MCU does not receive data in 5MHz communication. We want to communicate with the AP at 10MHz, but communication is not possible even at 5MHz. So, we ask for technical support on whether the SPI setting is wrong and whether there is an additional setting required.

 

Thank you.

 

0 项奖励
回复
1 解答
2,219 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

a setting looks right. Do you really call DSPI_SlaveTransfer before AP starts to send a frame?
You can also try to increase interrupt priority for slave SPI module.
Or try to use DMA based transfer type for higher rates

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,220 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

a setting looks right. Do you really call DSPI_SlaveTransfer before AP starts to send a frame?
You can also try to increase interrupt priority for slave SPI module.
Or try to use DMA based transfer type for higher rates

BR, Petr

0 项奖励
回复
2,181 次查看
kimdukyu
Contributor II

Hi,

I have set DMA according to your answer. Still we can't communicate at 5MHz.

Below is my DMA and SPI settings and code content.

 

1) Set DMA Component

kimdukyu_0-1665497086499.png

2) Set SPI Component

kimdukyu_1-1665497153417.png

3) Source code(Initialize components)

kimdukyu_2-1665497264071.png

kimdukyu_3-1665497309652.png

 

Please guide me if there are any wrong parts in the component settings and source code. And how do I set the interrupt priority? Please answer this issue.

 

Thank you.

 

 

0 项奖励
回复
2,169 次查看
kimdukyu
Contributor II
Dear Petr,

I solved the problem.
Thanks for your help.

0 项奖励
回复
1,990 次查看
s32k146_ige
Contributor IV

how did you solved issue?

0 项奖励
回复