8 years, 11 months ago.

SPI wiring seems not right on LPC1768 SPI port

I used 2 mbed LPC1768 boards to simulate the SPI communication, for the SPI master and SPI slave, the wire instruction is not normal, you have to connect like this way:

Mbed Master (SPI) Mbed Slave (SPI) p5 (MOSI) p5 (MOSI) p6 (MISO) p6 (MISO) p7 (SCK) p7 (SCK) p8 (CS) p8 (CS)

once connect the common ground of both mbed board, I can see it's working, but if I cross connect the p5 and p6 (supposed to be), i always get zero.

Anyone has a clue? or it'a bug ?

Question relating to:

2 Answers

8 years, 11 months ago.

You are not supposed to cross connect p5 and p6, but you have to connect p5 to p5 and p6 to p6

p5 = MOSI (Master Out, Slave In), so on your master p5 is the output and on the slave p5 is the input

p6 = MISO (Master In, Slave Out), so on your master p6 is the input and on the slave p6 is the output

If you cross connect p5 and p6, you are connecting two inputs to one another and two outputs to one another. I hope you see that's not how it's supposed to be :-)

8 years, 11 months ago.

I think the same instance of SPI pins for Master and Slave will come in conflict. Try using p5,p6,p7 for SPI master and p11,p12 and p13 for SPI slave.

He's using two separate processors as master and slave, so the pins will not conflict.

posted by Just Gary 29 May 2015