AnsweredAssumed Answered

MPC5746R DSPI problem

Question asked by lei he on May 13, 2018
Latest reply on Sep 25, 2018 by Jyothsna Rajan

  I using DSPI0 ad master, but it can't work. Then testing the sclk pin , there is no single . 

Can you help me to see what the problem is?

MPC57XX motherboard + MPC5746R-176DC

 

code:

void DSPI0_Init_Master(void)
{
DSPI_0.MCR.R = 0xC0080001;
DSPI_0.MODE.CTAR[3].R = 0x78021003; //baud rate is 1M

//sout pk2 ps2
SIUL2.MSCR0_255[187].B.ODC = 2;
SIUL2.MSCR0_255[187].B.OERC = 3;
SIUL2.MSCR0_255[187].B.SSS = 0x0D;
//sin pk1 ps1
SIUL2.MSCR0_255[186].B.IBE = 1;
// SIUL2.MSCR0_255[186].B.SSS = 5;
//SIUL2.MSCR0_255[186].B.ILS = 1;
//SIUL2.MSCR512_995[809-512].B.SSS = 0x02;
//sclk pj14 pj14
SIUL2.MSCR0_255[158].B.ODC = 2;
SIUL2.MSCR0_255[158].B.OERC = 3;
// SIUL2.MSCR0_255[158].B.SSS = 0x0E;
//cs3 ptk0 ps0
SIUL2.MSCR0_255[185].B.ODC = 2;
SIUL2.MSCR0_255[185].B.OERC = 3;
SIUL2.MSCR0_255[185].B.WPUE = 1;
SIUL2.MSCR0_255[185].B.SSS = 0x0D;


DSPI_0.MCR.B.HALT = 0x0;
}

 

main:

 

DSPI0_Init_Master();

while(1)
{
counter ++;
DSPI_0.PUSHR.PUSHR.R = 0xB8085678;
while (DSPI_0.SR.B.TCF != 1){}
DSPI_0.SR.R = 0xFCFE0000;
//while(counter --);
}

Outcomes