Issue with SPI as slave mode in MKL17Z64

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

Issue with SPI as slave mode in MKL17Z64

683 Views
vigneshmohan
Contributor I

I am using Freescale MKL17Z64 with KSDK configured MKL17Z64 in slave mode(FIFO enabled) and sending 5 bytes (0x01,0x02,0x03,0x04,0x05) to Master. I am expecting (0x01, 0x02,0x03,0x04,0x05) in master.

I send 1st 6 dummy bytes(0xFF,0xFF,0xFF,0xFF,0xFF) from master to read slave data I get response (0x01 0xFF 0xFF 0xFF 0xFF 0xFF)  in master during this period SS is pulled low by master and same continues when I do 2nd , 3rd , 4th… dummy transfers slave responds with (0x02 0xFF 0xFF 0xFF 0xFF 0xFF)  , (0x03 0xFF 0xFF 0xFF 0xFF 0xFF)  , (0x04 0xFF 0xFF 0xFF 0xFF 0xFF) … respectively.

So every SS interrupt I get one byte transfer from Slave FIFO.

 

Is it possible to get all 5 bytes from slave at one shot by using single SS interrupt (OR) should we need to toggle SS for each byte?

 

Awaiting for your reply. Thanks in advance.

Labels (1)
0 Kudos
2 Replies

322 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello vignesh,

Which function do you used transfer the data ? I recommend you use

spi_status_t SPI_DRV_SlaveTransferBlocking()

You can refer to the demo code under the KSDK installation directory :

KSDK_1.3.0\examples\frdmkl27z\driver_examples\spi\spi_blocking\slave\kds

Hope it helps

Alice

0 Kudos

322 Views
vigneshmohan
Contributor I

yang,

Thanks for your input. The issue is resolved by making CPHA = 1. I could able to send all my TX FIFO bytes from slave to master

Regards,

vignesh M

0 Kudos