AnsweredAssumed Answered

SPI communication FRDM-KL46Z

Question asked by Philippe Calmettes Employee on May 20, 2014
Latest reply on Jul 8, 2014 by Philippe Calmettes

HEllo ,

 

I'm using a FRDM board to send SPI command to an external part with processor expert and  SM1: SPImaster_LDD component.

here below the component configuration :

SM1_SPImaster LDD.png

To send a SPI write command I used the following functions  and it's working fine:( I 'm using a GPIO to drive the CS)

 

 

static  uint8_t SpiWriteReg(uint8_t addr, uint8_t val) {

 

  SPI_CS_ENABLE();

  SPIWriteByte(addr); /* address */

  SPIWriteByte(val) ; /* data */

 

  SPI_CS_DISABLE();

  return ERR_OK;

}

 

static void SPIWriteByte(unsigned char write) {

  unsigned char dummy; 

  (void)SM1_ReceiveBlock(SM1_DeviceData, &dummy, sizeof(dummy));

  (void)SM1_SendBlock(SM1_DeviceData, &write, sizeof(write));

  while(!spi_DataReceivedFlag){}

}

But I have a problem with such commands, because there is a delay between both SPIWriteByte(adrr) & SPIWriteByte(val).

Could someone explain me how to send the same information without any delay as shown in the below picture:


SPI scope.png

 

Thanks for your help

Rgds

Philippe


Outcomes