KL25Z SPI SendBlock

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

KL25Z SPI SendBlock

404 Views
xiaocongfu
NXP Employee
NXP Employee

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

0 Kudos
1 Reply

256 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Xiaocong Fu:

Please refer to the response by colleague Marek Neuzil in your other thread:

KL25Z SPI SendBlock

I think his suggestion might be correct. Let us know if you still have problems.

Regards!

Jorge Gonzalez

0 Kudos