SPI setup question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,252件の閲覧回数
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,237件の閲覧回数
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,238件の閲覧回数
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,199件の閲覧回数
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,187件の閲覧回数
kimdukyu
Contributor II
Dear Petr,

I solved the problem.
Thanks for your help.

0 件の賞賛
返信
2,008件の閲覧回数
s32k146_ige
Contributor IV

how did you solved issue?

0 件の賞賛
返信