SPI Mode configuration in DSPI MPC5777c

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

SPI Mode configuration in DSPI MPC5777c

2,056 Views
dineshmoka
Contributor III

hi i want to transmit the extended frame format like 32 bits data for frame instead of 16 bits. shall i need to use  DSI mode or it can be achieved in SPI mode itself?

i am using MPC5777c-416 DS EVB

Tags (2)
0 Kudos
Reply
5 Replies

2,015 Views
dineshmoka
Contributor III

hi actually i am trying to communicate with IS38SML01G1 NAND Flash Memory with SPI interface. Here the address of the memory is 24 bits but in SPI mode i can send only 16 bits frame size only? so how to concatenate two frames in SPI mode? 

0 Kudos
Reply

2,028 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

This device’s DSPI is capable to receive 32-bit frame but it is only capable to transmit 16-bit frame. It is valid event for SPI mode.

For special cases where transmitted frames are not important, DSPI can be configured to receive 32-bit.

For symmetrical configuration - for instance two MPC5777C MCUs’ DSPI, it is needed to use two 16-bit frames with CONT bit set for the first one. It behaves the same way.

0 Kudos
Reply

2,010 Views
dineshmoka
Contributor III

hi actually i am trying to communicate with IS38SML01G1 NAND Flash Memory with SPI interface. Here the address of the memory is 24 bits but in SPI mode i can send only 16 bits frame size only? so how to concatenate two frames in SPI mode?

0 Kudos
Reply

2,000 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Use three 8-bit frames. First PUSH command will be configured with CONT=1, second with CONT=1 and third with CONT=0.
This way CS stays asserted between 8-bit frames and it acts as one 24-bit data frame.

0 Kudos
Reply

1,981 Views
dineshmoka
Contributor III

hi i am trying to concatenate two 8-bit data frames  by using DSPI_A(MASTER) and in loopback mode i want to receive single 16-bit data frame in DSPI_B(SLAVE) module. The following is the my code, but i am not receiving the data

#define TX_DATA_MASTER1 0x12u
#define TX_DATA_MASTER2 0x34u
#define TX_DATA_SLAVE 0x9876u


vuint32_t ui32_rx_data_master;
vuint32_t ui32_rx_data_slave;

void D_DSPI_loopback (){

ui32_rx_data_master = 0;
ui32_rx_data_slave = 0;

// Assigning pin configaration for input port of SPI_A

SIU.PCR[93].R = 0x0600; //SCKA
SIU.PCR[96].R = 0x0600; //PCSA0
SIU.PCR[95].R = 0x0600; //SOUTA
SIU.PCR[94].R = 0x0500; //SINA

SIU.PCR[103].R = 0x0500; //SINB
SIU.PCR[104].R = 0x0600; //SOUTB
SIU.PCR[102].R = 0x0500; //SCKB
SIU.PCR[105].R = 0x0500; //PCSB0

SIU.DISR.R = 0x40540000; // Definition of SPI_A & SPI_B parameters

DSPI_A.MCR.R = 0x800F0001;
DSPI_A.MODE.CTAR[0u].R = 0x2A0A7727u;
DSPI_A.MCR.B.HALT = 0x0u;

DSPI_B.MCR.R = 0x000F0001u;
DSPI_B.MODE.CTAR[0u].R = 0x7A0A7727u;
DSPI_B.MCR.B.HALT = 0x0u;

DSPI_B.PUSHR.PUSHR.R = 0x00000000u|TX_DATA_SLAVE;

DSPI_A.PUSHR.PUSHR.R = 0x80010000u|TX_DATA_MASTER1;
DSPI_A.PUSHR.PUSHR.R = 0x08010000u|TX_DATA_MASTER2;

while (DSPI_A.SR.B.RFDF != 1u)
{}
ui32_rx_data_master = DSPI_A.POPR.R;

DSPI_A.SR.R = 0x90020000u;

while (DSPI_B.SR.B.RFDF != 1u)
{}
ui32_rx_data_slave = DSPI_B.POPR.R;
DSPI_B.SR.R = 0x90020000u;
}

please let me know any corrections are there?

0 Kudos
Reply