SPI Test on MPC5748G EVB  failed

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

SPI Test on MPC5748G EVB  failed

1,161 Views
huqiang
Contributor IV

Hi,

I try to test the SPI module on MPC5748G, but failed. The attachment is my project code.

First, I connnected the I/O as the "Qorivva Recipes for MPC574xG" .

144803_144803.PNGCapture.PNG

144804_144804.jpg801983375695597131.jpg

 

144805_144805.jpg587861054377355697.jpg

After I ran the project, I checked the four signal.

The DSPI_3 SCK (PG4)is :144806_144806.jpg64240622834578655.jpg
The DSPI_3 SOUT (PG2) is :

144807_144807.jpg29695106730447277.jpg

The DSPI_3 CS0 (PG3) is:

144808_144808.jpg177926270168555599.jpg

BUT !

The DSPI_3 SIN (PG5) is not correct :

144809_144809.jpg40244953246001329.jpg

Is there something that I did wrong ?

Can you help me check whether my project is correct ?

Thank you very much !

Qiang

Original Attachment has been moved to: mpc5748g_Z4_1.zip

Labels (1)
4 Replies

749 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Pads K14, K15, and L0 are not available on the 176LQFP package you have. That’s why the slave (SPI_1) does not respond.

Use different pins for SPI_1 module. For example try this configuration.

/* Slave - SPI_1 */

SIUL2.MSCR[148].B.SSS = 1;      /* Pad PJ4: Source signal is SPI_1 CLK */

SIUL2.MSCR[148].B.IBE = 1;      /* Pad PJ4: IBE=1. */

SIUL2.IMCR[816-512].B.SSS = 1;      /* Pad PJ4: SPI_1 CLK */

SIUL2.MSCR[127].B.SSS = 1;                /* Pad PH15: Source signal is SPI_1 SOUT */

SIUL2.MSCR[127].B.OBE = 1;      /* Pad PH15: OBE=1. */

SIUL2.MSCR[127].B.SRC = 3;      /* Pad PH15: Full strength slew rate */

 

SIUL2.MSCR[145].B.IBE = 1;      /* Pad PJ1: Enable pad for input SPI_1 SIN */

SIUL2.IMCR[815-512].B.SSS = 1;      /* Pad PJ1: connected to pad */

SIUL2.MSCR[146].B.IBE = 1;      /* Pad PJ2: IBE=1. SPI_1 SS */

SIUL2.IMCR[817-512].B.SSS = 2;      /* Pad PJ2: connected to pad */

PJ1 and PJ2 pads are located on P24 connector.

BR, Petr

749 Views
huqiang
Contributor IV

Hi, Petr

May I interrupt you for a moment.

This time,I try to enable the transfer complete interrupt request, but I can't work it out.

I use the /* Vector # 289 DSPI3_3 DSPI_3_SR[TCF] */ in "intc_SW_mode_isr_vectors_MPC5748G.c"

and set its priority for core 0, priority 2;

But my project can not go into this SPI interrupt.

The attachment is my project.

Can you help me find out what's problem I have made?

Thank you !

Qiang

0 Kudos

749 Views
alexvinchev
Contributor V

It seems that you'll have to read about DSPIx_RSER register, especially bit 0 (TCF_RE), page 1294 in the RM.

749 Views
huqiang
Contributor IV

Hi,

I changed the pins and it can works now.

Thank you for helping me.

Qiang

0 Kudos