Problem about SPI of MPC5744P

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

Problem about SPI of MPC5744P

1,096 Views
nathan_
Contributor IV

I want to use the SPI module  of MPC5744P to communicate with another chip in the controller board.

The following are my config:

//PORT CONFIG

SIUL2.MSCR[PC6].B.SSS = 1; /* PC6: Source signal is DSPI_0 SOUT */
SIUL2.MSCR[PC6].B.OBE = 1;
SIUL2.MSCR[PC6].B.SRC = 3;

SIUL2.MSCR[PC5].B.SSS = 1; /* PC5: Source signal is DSPI_0 CLK */
SIUL2.MSCR[PC5].B.OBE = 1;
SIUL2.MSCR[PC5].B.SRC = 3;

SIUL2.MSCR[PC7].B.IBE = 1; /* PC7: Enable pad for input DSPI_0 SIN */
SIUL2.IMCR[41].B.SSS = 1;

SIUL2.MSCR[PB2].B.SSS = 2; /* PB2: Source signal is DSPI_0 CS4 */
SIUL2.MSCR[PB2].B.OBE = 1; /* PB2: OBE=1. */
SIUL2.MSCR[PB2].B.SRC = 3;

//SPI_0 INIT

SPI_0.MCR.R = 0x80010001; /* Configure DSPI_0 as master */
SPI_0.MODE.CTAR[0].R = 0x7E0A0010;/*0x7EAA0010;*/ /* Configure CTAR0 */
SPI_0.MCR.B.HALT = 0x0; /* Exit HALT mode: go from STOPPED to RUNNING state*/

//SEND 

SPI_0.PUSHR.PUSHR.R  = /*0x08013400;*/0x08013001;

When I use the oscilloscope to detect the SDO and SCK of the 5744, I detected the correct waveform,

But the output of the B[2] pin which is used as the SPI0 PCS4 is always low, which is not what I want.

Actually I want the SPI0 PCS4 to be low when the message is conveyed and to be high when the communication 

is not activated.

What should I do to get the correct output of SPI0 PCS4? Are there any mistakes in my config?

Or someone have any examples?

Thanks in advance.

4 Replies

687 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 as you want to use CS4 you must set different PCS bit in the MCR and PUSH register, so the CS4 will be driven.

Use

SPI_0.MCR.R = 0x80100001; /* Configure DSPI_0 as master, PCS4 inactive high */

SPI_0.PUSHR.PUSHR.R  = 0x08103400; 

BR, Petr

687 Views
nathan_
Contributor IV

Thank you very much , the problem has been solved

0 Kudos

687 Views
nathan_
Contributor IV

The chip I want to communicate with is as follows:

SPI.JPG

So the PCS needs to be low when there is SCK, but te result of PCS is always low.

0 Kudos

687 Views
nathan_
Contributor IV

The SDO and SCK is as follows:

SPI波形.jpg

But the output of SPI PCS4 is always low.

What is the problem?

0 Kudos