SPI setup question

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

SPI setup question

Jump to solution
1,506 Views
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 Kudos
Reply
1 Solution
1,491 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,492 Views
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 Kudos
Reply
1,453 Views
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 Kudos
Reply
1,441 Views
kimdukyu
Contributor II
Dear Petr,

I solved the problem.
Thanks for your help.

0 Kudos
Reply
1,262 Views
s32k146_ige
Contributor IV

how did you solved issue?

0 Kudos
Reply