SS signal becomes high state every byte on SPI_MasterTransferBlocking API

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

SS signal becomes high state every byte on SPI_MasterTransferBlocking API

Jump to solution
511 Views
shuichiy
Contributor III

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); 

Labels (1)
0 Kudos
1 Solution
354 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
2 Replies
355 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos
354 Views
shuichiy
Contributor III

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.

0 Kudos