SPI slave MISO line issue (XMC4500 + XMC1201)

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

cross mob
Not applicable
Hello everyone,

I got a strange communication issue between a master (XMC 4500) and more than one slave (XMC1201 + port expander card which communicates via SPI).
On my board it's possible to plug in 2 different cards on the same SPI-port (every card gets an chip select and the master toggles between them).

When the master communicates with one slave (MCP23S17 -> port expander card), the waveform of the MISO looks like expected (image below).
1401.attach

The problem starts when the master communicates with both cards -> port expander card and an additional XMC1201 in slave mode (SPI003-app was used).
This looks like the slave is pulling up the MISO-line very strong and the MCP23S17 can't pull the line to ground when it gets the /CS. So the master thinks, due to the wrong voltage level, that the slave sends 0xFF instead of 0x00.
1402.attach


I'm not sure what I can do to prevent this behaviour. In a workaround I could configure the MISO-line to tristate when the end-of-message interrupt occures and reconfigure it at the start of the message (not really smart imho). This could prevent data corruption for other cards.

Thanks in advance for any help !

best regards
Sebastian
0 Likes
3 Replies
chismo
Employee
Employee
First like received
Hi Sebastian,

When the USIC SSC slave in the XMC devices is inactive, it outputs the passive level defined by the register bit field SCTR.PDL.

In the multi-slave setup that you have, I would suggest either:
1) the workaround you mentioned to enable the slave MISO line only when it is required to transmit
2) or if possible, to have the MISO line in an open drain configuration with an external pull-up.

Regards,
Min Wei
0 Likes
User9202
Level 1
Level 1
Hi Sebastian, hi Min Wei,

I have the same problem with a XMC1402. How did you solve this?

1) How can you enable/disable the slave MISO line?
2) PDL can only be set to 0 (the passive data level is 0) or 1(the passive data level is 1) but you can't set it to open drain...

Regards,

Juergen
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi Juergen,

1. You enable/disable the MISO pin at the slave by configuring the pin as input/alternate ouput.

// enable MISO
XMC_GPIO_SetMode(MISO, XMC_GPIO_MODE_OUTPUT_PUSH_PULL | XMC_GPIO_MODE_OUTPUT_ALTx);

// disable MISO
XMC_GPIO_SetMode(MISO, XMC_GPIO_MODE_INPUT_TRISTATE);
or
XMC_GPIO_SetMode(MISO, XMC_GPIO_MODE_INPUT_PULL_UP);


2. To configure the MISO as alternate output open drain instead of push pull

XMC_GPIO_SetMode(MISO, XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN | XMC_GPIO_MODE_OUTPUT_ALTx);


Are you using APPs? If so, in the Pin Settings tab you can change the mode from push pull to open drain easily.


Regards,
Jesus
0 Likes