AnsweredAssumed Answered

KL25Z SPI SendBlock

Question asked by Xiaocong Fu Employee on May 19, 2015
Latest reply on May 25, 2015 by Jorge_Gonzalez

Hello,

I have a problem when I use SPI in KL25Z to send data.

Configuration of SPI is:

Capture1.PNG

The code used to send data:

uint16_t Test_VBA_Buffer;

uint8_t SM1_Send[3];

SM1_Send[0] = 0;

SM1_Send[1] = Test_VBA_Buffer>>2;

SM1_Send[2] = Test_VBA_Buffer<<6;

SM1_SendBlock(SM1_Data, SM1_Send, sizeof(SM1_Send));

  while (!SM1_GetBlockSentStatus(SM1_Data)) {        

  SM1_Main(SM1_Data);

}

 

Here 'SM1_Send' is 24 bits.

 

The problem is as shown:

image1.JPG

Sometimes a delay appears in the middle of CS and Clock. The length of delay also varies: normally 8 bits but sometimes 1 bit. With this delay, I can't get correct output as expected.

 

Does someone have the same problem or have a solution?

 

Thanks,

 

Xiaocong

Outcomes