AnsweredAssumed Answered

Problem with SPI interrupt

Question asked by Durgesh Tanuku on Jan 14, 2015
Latest reply on Jan 15, 2015 by Durgesh Tanuku

In my code, I need to write data into flash, which is interfaced to my KL26Z through SPI.


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

error = SM0_SendBlock(masterDevData, (LDD_TData*)Data,Number_Of_Bytes);

if(error !=ERR_OK)

return SLLD_ERROR;

 

error = SM0_ReceiveBlock(masterDevData, (LDD_TData*)dummyBuffer,Number_Of_Bytes);

if(error!=ERR_OK)

return SLLD_ERROR;

 

while(Tx_CompleteFlag==0);

Tx_CompleteFlag=0;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

I am setting Tx_CompleteFlag in SPI_OnBlockSent event in Events.c

 

My requirement needs Tx_CompleteFlag to be set after transmission of Number_Of_Bytes mentioned above. But I am getting interrupt after tx of only a single character.

 

If any of you know the solution kindly reply me

 

regards,

Durgesh

Outcomes