DSPI to Slave mode

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

DSPI to Slave mode

1,204 Views
Kr_Blue
Contributor I

Hi All.

 

 

 I'm currently using MPC5604P products.

This product is using the DSPI communication.

MCU is a Slave. 

                   

             DSPI_1.MCR.R = 0x00010001;           /* Configure DSPI_1 as slave */
             DSPI_1.CTAR[0].R = 0x7A0A7727;     /* Configure CTAR0 */
             DSPI_1.MCR.B.HALT = 0x0;                 /* Exit HALT mode: go from STOPPED to RUNNING state*/
             DSPI_1.RSER.B.RFDFRE = 1;            /* Receive FIFO drain request enable */

             SIU.PCR[6].R = 0x0503;                        /* MPC56xxP: Config pad as DSPI_1 SCK input */
             SIU.PCR[8].R = 0x0103;                        /* MPC56xxP: Config pad as DSPI_1 SIN input */
             SIU.PCR[7].R = 0x0604;                        /* MPC56xxP: Config pad as DSPI_1 SOUT output*/
                    SIU.PCR[5].R = 0x0503;                        /* MPC56xxP: Config pad as DSPI_1 PCS0/SS input */

 

 

 

       Master <--------------------> Slave
Data_MOSI_0                     Data_MISO_ 0
Data_MOSI_1                     Data_MISO_ 1
Data_MOSI_2                     Data_MISO_ 2
Data_MOSI_3                     Data_MISO_ 3
Data_MOSI_4                     Data_MISO_ 4
Data_MOSI_5                     Data_MISO_ 5

Interrupters using the Master program coding side, thinking about Data_MOSI_0 to Data_MISO_1 responses.

If you need to communicate the above in Data_MISO_0 Data are wondering how to save.

 

  

Thank you.



Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

834 Views
Kr_Blue
Contributor I

I think ....

 

while (DSPI_1.SR.B.RFDF != 1){} /* Wait for Receive FIFO Drain Flag = 1 */
RecDataSlave = DSPI_1.POPR.R; /* Read data received by slave SPI */
DSPI_1.SR.R = 0x80020000; /* Clear TCF, RDRF flags by writing 1 to them */

0 Kudos
Reply