SPI Slave: Pin assigment

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

cross mob
User9654
Level 1
Level 1
Dear support team,

I programmed a SPI-master (XMC_SPI1_CH0) and a SPI-slave (XMC_SPI0_CH0) for a XMC4500-("Relax-Kit-Lite")-board.
For a first test without external components, both should interact with each other.
I had some trouble to get a working communication between them until I figured out, that the assignment
of the pins was the problem.

//XMC_GPIO_SetMode(P0_8, XMC_GPIO_MODE_INPUT_TRISTATE);
//XMC_SPI_CH_SetInputSource(SPI_2, XMC_SPI_CH_INPUT_SLAVE_SCLKIN,USIC0_C0_DX1_P0_8); // does not work
XMC_GPIO_SetMode(P1_1, XMC_GPIO_MODE_INPUT_TRISTATE);
XMC_SPI_CH_SetInputSource(SPI_2, XMC_SPI_CH_INPUT_SLAVE_SCLKIN,USIC0_C0_DX1_P1_1);


According to table 17-1 in the reference manual and table 11 in the datasheet, I assumed that both assignments would work.
Both can be build in DAVE, but only the second one lead to a working communication
in the board.

When the clocks of master and slave (P0_8 and P0_11) are connected, the clock line is continously pulled high;
it seems, that the output pin of the master is not able to drive it.
Removing the connection, the clock line of the master shows the expected alternating pattern, P0_8
remains high.

Due to the schematic of the "Relax-Kit-Lite"-board, there is no additional connection on P0_8.

I am not sure about a hardware problem or a misunderstanding of the manuals of mine.

Thank you very much.
0 Likes
1 Reply
chismo
Employee
Employee
First like received
Hello,

I don't think there is any limitation on the usage of P0.8 (DX0B) on the Relax Kit lite. I would expect it to work similar to P1.1 (DX0A).

Do you know if the high seen at P0.8 is specific to the slave SPI mode? For example, if toggling P0.8 as a general purpose output pin or as a SPI master SCLKOUT works?

Regards,
Min Wei
0 Likes