AnsweredAssumed Answered

SPI OnBlockSent too early

Question asked by trow on Mar 18, 2014
Latest reply on Mar 28, 2014 by trow

Im Using Processor Expert to write Code for an SPI Application (KL26z Eval Board). Now I'm having problems with the SPI OnBlockSent() function. It seams as this event is called when all Data is written to the SPI Buffer, but the Data is not yet written out. But I need to know when the Data is really sent out to the BUS. Is there any possibility?

 

Main:

 

  SPI_DataSentFlag = FALSE;

  Error = SPI0_SendBlock(SPI0_DeviceData , OutData, BLOCK_SIZE);    /* Start transmission/reception */

  while (!SPI_DataSentFlag) {};                            /* Wait until data block is transmitted/received */

 

-> this place is reached before the whole Data is sent out to the BUS.

 

  Event.c:

  void SPI0_OnBlockSent(LDD_TUserData *UserDataPtr)

  {

    SPI_DataSentFlag = TRUE;

  }

 

 

 

Thanks a lot!

Outcomes