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" .
After I ran the project, I checked the four signal.
The DSPI_3 SCK (PG4)is :
The DSPI_3 SOUT (PG2) is :
The DSPI_3 CS0 (PG3) is:
BUT !
The DSPI_3 SIN (PG5) is not correct :
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
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
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
It seems that you'll have to read about DSPIx_RSER register, especially bit 0 (TCF_RE), page 1294 in the RM.
Hi,
I changed the pins and it can works now.
Thank you for helping me.
Qiang