AnsweredAssumed Answered

SPI communication with KSDK 1.3 using "fsl_spi" and Processor Expert - Chip Select Problems

Question asked by Andre Lemke on Jan 27, 2016
Latest reply on Jan 29, 2016 by isaacavila

Hi!

 

I'm working with the Kinetis KL27Z connected with a SPI Flash Memory through SPI module.

Everything is working fine controlling the Chip Select or "Chip Enable" externally of the SPI functions using the "fsl_gpio", but I would like to control using the proper control of “Slave Select Pin” provided by “fsl_spi”. I had some tests and the device doesn’t answer when I’m sending or receiving more than one byte…

 

Here is the logic diagram provided by the memory manufacturer (Reading Chip ID, for example):

SPI Read ID sequence.jpg

 

I'm using this component and their function:

SPI função master transfer.jpg

 

The "fsl_gpio" configuration:

 

SPI GPIO.png

 

 

I needed to add a little delay to correct the toggle time of the “chip select “logic level. The code is shown below:

SPI Código por fora da função.jpg

 

The device is working fine, like the proposal of the manufacturer:

SPI Chip Select por fora.jpg

 

Until here is ok, the device is working… But I would like to don’t use “delays” or “blocking” functions. I just need to use the interface with interrupts and live my main function free!

 

When I put the configuration of the “Slave Select Pin”, like below some problems occur...

SPI PEx Slave Select.jpg

 

The code...

codigo sem chip en.jpg

 

...and device toggle the "Chip Enable" between each byte sent or received. The logic diagram is shown below:

SPI Chip Select por dentro.jpg

 

My doubts are: It's a bug from the KSDK 1.3 or isn't possible to transfer multiple data bytes using just "fsl_spi" configurations?

 

Sorry my english... Thank's!

Outcomes