11 years, 8 months ago.

No access to SPI1 on mbed/Freedom board KL25z?

Hi,

yesterday my Freedom board KL25Z arrived and I am pretty impressed how smooth everything works. I am trying to communicate with an SDCard and an Orientation sensor over SPI. With the LPC1768 I already managed to set my project up, but for several reasons the Freedom board looked like the better choice to me.

So here comes my issue: For the beginning, I am trying to connect an OLED display. When setting up SPI0, everything works fine:

SPI2 gSpi(PTD2,NC,PTD1);

However, if I want to connect via the second SPI port (SPI1)

SPI2 gSpi(PTD6,NC,PTD5);

the red LED is blinking. I guess this is now the "red light of death?".

From the Freescale pinout diagram it is obvious that there is this second SPI, and on your homepage your write about the board that it offers two SPI ports.

So what do I need to do to access the second SPI?

Thank you in advance for any hint!

Regards

3 Answers

11 years, 6 months ago.

Thanks Tobias,

I was unable to get an SD card to work with SPI0 (PTD0, 2, 3, 1), but using the SPI1 pins you found above (PTE4, 1, 3, 2), it works fine. I am using the SparkFun BOB-00544 microSD breakout board. Somewhere on the site, I saw that SPI0 has a conflict with the blue on-board led, possibly causing my problem with SPI0. The MBED developers should publicize your discovery of SPI1. Thanks again.

Y.

11 years, 5 months ago.

Hi,

I agree with Tobias Piroth.

SPI0 will not work when you have DigitalOut led_blue(LED_BLUE); in your program. As said apparent there is a conflict between the blue led and SPI0

Gerrit

11 years, 8 months ago.

Hi,

It seems I found an answer by myself: I used different pins. At least controlling two separate SPI displays works now via separate SPI ports works now. I use the following configuration:

/*
SPI 0
CS = PT D0
MOSI = PT D2
MISO =  PT D3
SCK =  PT D1


SPI 1
CS = PT E4
MOSI = PT E1 (Data out of MCU)
MISO = PT E3
SCK = PT E2
*/

@mbed-Team: Why can't I choose pins according to all suggested SPI pins as stated in the pinout-diagram?

Thanks Tobias, I wasn't able to get a microSD card to work on SPI0, possibly due to a conflict with the blue on-board led. But your pinout for SPI1 above (PTE4, 1, 3, 2) works great. I am using Sparkfun's BOB-00544, microSD breakout board. The MBED developers should publicize thaat SPI1 is available. Thanks again.

Y.

posted by Yale E. Goldman 03 May 2013