SPI_MASTER APP "coded select mode"

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User17556
Level 1
Level 1
Is there any possibility to enable the coded select mode with the SPI_MASTER APP?

I've tried the following, but only XMC_SPI_CH_SLAVE_SELECT_1 gets active during sending:


XMC_SPI_CH_EnableSlaveSelectCodedMode(SPI_MASTER_0.channel);

XMC_SPI_CH_EnableSlaveSelect(SPI_MASTER_0.channel,XMC_SPI_CH_SLAVE_SELECT_2| XMC_SPI_CH_SLAVE_SELECT_1|XMC_SPI_CH_SLAVE_SELECT_0);

if(SPI_MASTER_Transmit(&SPI_MASTER_0, cMemLEDOut, MEM_LED_SIZE) == SPI_MASTER_STATUS_SUCCESS){
// logfUart("section %d transmitted.",currentSection);
}
else{
logfUart("error in SPI transmit\n");
}
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Please check XMC_SPI_CH_EnableSlaveSelectCodedMode() and XMC_SPI_CH_DisableSlaveSelectCodedMode().

Regards,
Jesus
0 Likes
User17556
Level 1
Level 1
Hi,

As you can see, I've used XMC_SPI_CH_EnableSlaveSelectCodedMode().

I've also double checked the Register values:
PCR.SELCTR = 0,
PCR.SELO = 0x07 -> (00111) -> CS-Line 0,1 and 2

Is there any other setting neccessarry?

3671.attach

Thanks
0 Likes
User17556
Level 1
Level 1
I've solved my problem:

By default SELMD is set to 1 which means that the chipselect lines are set automatically using the TCI information of the buffer.
That's why only SELO0 was active.

This additional code solved my problem:
  // deactivate TCI to SELO (auto chipselect from FIFO buffer)
SPI_MASTER_0.channel->TCSR &= ~(USIC_CH_TCSR_SELMD_Msk);
0 Likes