AnsweredAssumed Answered

SPI on MPC5744P Sending Problem

Question asked by NI HAO on Jun 25, 2018

Hi everyone!

I use MPC5744P connecting allegro A4962 through SPI. And I use S32 DS 0.90 SDK. According to the example of mpc5746g,I use the functions

 

DSPI_MasterInit(INST_DSPI1, &dspi1State, &dspi1_MasterInitConfig0);


DSPI_MasterSetDelay(INST_DSPI1, 1, 1, 1);

 

to Initlize the spi module and use

 

DSPI_MasterTransferBlocking(INST_DSPI2,master_send, master_receive,
NUMBER_OF_FRAMES, TIMEOUT);

 

to transfer data. The data is

 

#define BUFFER_SIZE 1U
#define TIMEOUT 10000U
#define NUMBER_OF_FRAMES 2U

 

uint16_t master_send[BUFFER_SIZE] = {0x82D6};
uint16_t master_receive[BUFFER_SIZE];

 

I can use oscilloscope to capture the waveform of sending,and it's the same as I set. But how I check the slave,the allegro A4962,receving right or not?I didn't find the function in dspi module in SDK0.9.0.

I suppose the sending data being correct and the slave A4962 can be receving correctly.But when I connected the motor to the connector,the motor just shaked 1-2 seconds then stopped.

 

Here is the configuration of dspi module. There is no slave configuration,MPC5744P is just set as master.

 

So is there someone know where the wrong is?

 

Thanks a lot!

Outcomes