KL16Z - how is SPI CS toggling controlled?

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

KL16Z - how is SPI CS toggling controlled?

1,786 Views
bgraham
Contributor IV

MCUXpresso IDE v10.2.1

MKL16Z256256VLH4

I am using SPI with DMA.

SPI_MasterGetDefaultConfig(&m_masterConfig);
m_masterConfig.outputMode = kSPI_SlaveSelectAutomaticOutput;

sourceClock = CLOCK_GetFreq(tSPI_ClockSource);
SPI_MasterInit(pBaseSPI, &m_masterConfig, sourceClock);

SPI_MasterTransferCreateHandleDMA(...

When the SPI bus transfers occur, the Chip Select is getting toggled between each byte. The toggling of the chip select does not work with my SPI slave (ADXL363 Accelerometer).

See attached image. How do I disable Chip Select toggling between bytes?

Thanks,

Bruce Graham
Senior Software Engineer
TechnoSoft Innovations, Inc.

pastedImage_2.png

0 Kudos
3 Replies

1,567 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

From KL16 reference manual chapter 35 SPI module description, there is no way to make /SS output continue low during communication. The /SS pin will back to high during idle status.

pastedImage_1.png

If customer want to use /SS always during SPI communication, customer can use a GPIO pin to emulate SPI chip select function.

Thank you for the attention.


Have a great day,
Mike

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,567 Views
bgraham
Contributor IV

I have a hard time believing somebody designed SPI hardware with a chip

select toggle problem. The toggling problem will prevent 99.999% of all SPI

peripheral devices from working.

Was the chip select toggle problem caused by a incompetent MCU designer, or

can I by-pass the SPI APIs and turn off the screwed up toggling problem?

Thanks,

Bruce

0 Kudos

1,567 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I double check with Kinetis product team that KL16 SPI doesn't support chip select continue low during transfer.

It needs to use a GPIO pin emulate.

Thanks for the attention.


Have a great day,
Mike

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos