DSPI demo for MPC5748G

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

DSPI demo for MPC5748G

1,115 Views
dsytj88
Contributor II

Hi Supporter

With MPC5748G dspi demo(DSPI_MASTER_MPC5748g),config DSPI0 with master node and SPI0 with slave node.

the init scrips is as belows:

EDMA_DRV_Init(&dmaController1_State,&dmaController1_InitConfig0,edmaChnStateArray,edmaChnConfigArray,EDMA_CONFIGURED_CHANNELS_COUNT);
  DSPI_MasterInit(DSPI0_INSTANCE, &dspi1State, &dspi1_MasterInitConfig0);
  /* SPI slave configuration: clock speed: 500 kHz, 8 bits/frame, MSB first */
  DSPI_SlaveInit(SPI0_INSTANCE, &dspi2State, &dspi2_SlaveInitConfig0);
  /* Configure delay between transfer, delay between SCK and PCS and delay between PCS and SCK */
  DSPI_MasterSetDelay(DSPI0_INSTANCE, 1, 1, 1);

and in while functon,the script is as belows:
   DSPI_SlaveTransfer(SPI0_INSTANCE, slave_buffer.tx, slave_buffer.rx, NUMBER_OF_FRAMES);
   DSPI_MasterTransferBlocking(DSPI0_INSTANCE, master_buffer.tx, master_buffer.rx, NUMBER_OF_FRAMES, TIMEOUT);

after building and when debuging the script,I see master can receive data from slave node correctly,but slave node can't receive data from master,the slave receive buffer is 0.

I have attached all the related configuration file,is there any thing wrong with the configuration?please help to check where is the problem,thank you.

0 Kudos
2 Replies

1,072 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

so you modify the default project to add DMA mode for slave.

I tried to do the same, besides a config you have I changed DMA component to have 

pastedImage_1.png

Then after generating PE code and build I tested it on DEVKIT board with below connection

pastedImage_2.png

 Both the slave and master receive data properly.

BR, Petr

0 Kudos

1,067 Views
jettzhou
Contributor I

Hi Petr

I have counter the same problem now, can you share the example of sending and receiving data properly. thanks a lot

0 Kudos