Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

[XMC4800] USIC as SPI - MSLS Problem

$
0
0
Hello,

I would like to use some GPIOs as additional Slave Select signals. But I do get a timing problem with the gpio slave select signal. it is way faster then the hardware slave select signal. My setup is as following.:

I'm using the XMC Llib to control the USIC, and I'm generating a hardware slave select signal which is not exposed to a pin which sets the MSLS Bit in the PSC register and wait till it is cleared. But it seems that that bit is cleared way to fast by the hardware and so my gpio slave select signal has no chance to accomplish the required timing.

Here is a little sample code which illustrates my problem.

Code:

while(1U) {
    XMC_GPIO_SetOutputLow(SOFT_CS);
    XMC_SPI_CH_EnableSlaveSelect(SPI2_CH1, XMC_SPI_CH_SLAVE_SELECT_0);

    XMC_SPI_CH_Transmit(SPI2_CH1, 'A', XMC_SPI_CH_MODE_STANDARD);
    while((XMC_SPI_CH_GetStatusFlag(SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) == 0U);
    XMC_SPI_CH_ClearStatusFlag(SPI2_CH1, XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION);

    XMC_SPI_CH_DisableSlaveSelect(SPI2_CH1);

    // Wait till MSLS disabled
    while((XMC_SPI_CH_GetStatusFlag(SPI2_CH1) & XMC_SPI_CH_STATUS_FLAG_MSLS) == 1U);


    XMC_GPIO_SetOutputHigh(SOFT_CS);
}

I'm also attaching a picture of both SPI slave select signals. The first channel is the hardware slave select and second channel is the GPIO slave select.

Attachment 2814

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>