I'm using KSDK2.0 with MDK ARM and MKL17Z256.
In the codes in below, SS signal becomes low at the beginning of transfer correctly, but it becomes high just after the 1st byte has transferred.
I want SS is continuously low state until all bytes has transferred but I cannot find the solution.
Do you have any suggestions ?
SPI_MasterGetDefaultConfig(&masterConfig);
sourceClock = CLOCK_GetFreq(EXAMPLE_SPI_MASTER_SOURCE_CLOCK);
SPI_MasterInit(EXAMPLE_SPI_MASTER, &masterConfig, sourceClock);
srcBuff[0] = 0x05; // Instruction
srcBuff[1] = 0xFF; // dummy
xfer.txData = srcBuff;
xfer.rxData = destBuff;
xfer.dataSize = 2;
SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &xfer);
Solved! Go to Solution.
Hi,
Regarding your question, if the SPI is configured as master mode, if you set the MODFEN bit as 1 in SPIx_C2 register, set the SSOE bit as 1 in SPIx_c1 register, the /SS pin will be LOW automatically when the data is transferred. During the interval between two data transfer, the /SS pin becomes HIGH automatically. If you want to leave the /SS pin always LOW even if it is in the interval between two data transfer, you have to use the /SS pin as GPIO output mode, you can set/clear the GPIO as you desired by software.
Pls check if the MODFEN=SSOE=1 in debugger.
Hope it can help you.
BR
Xiangjun Rong
Hi,
Regarding your question, if the SPI is configured as master mode, if you set the MODFEN bit as 1 in SPIx_C2 register, set the SSOE bit as 1 in SPIx_c1 register, the /SS pin will be LOW automatically when the data is transferred. During the interval between two data transfer, the /SS pin becomes HIGH automatically. If you want to leave the /SS pin always LOW even if it is in the interval between two data transfer, you have to use the /SS pin as GPIO output mode, you can set/clear the GPIO as you desired by software.
Pls check if the MODFEN=SSOE=1 in debugger.
Hope it can help you.
BR
Xiangjun Rong
Since I have seen something continuousSCK option on MK22 SDK, I had expected similar function.
Well, I understand I need to control SS as GPIO separately, thanks.