9 years, 7 months ago.

Connecting SPI to PC9 & PC8 gives "pinmap not found for peripheral"

Hi,

I am trying to connect to a DAC via SPI using the following line;

SPI xdac_spi(PC_9, NC, PC_8);

But this results in the following error being returned via the serial connection

"pinmap not found for peripheral"

I have diagnosed the problem to be coming from the terms PC_9 and PC_8. If I swap these pins out for other pins it works. Due to hardware constraints I can't use other pins without changing the design. Why cant these pins be used?

1 Answer

9 years, 7 months ago.

Because these pins do not have the option to be connected to a SPI peripheral, so it simply is not possible. For the complete pinout options, see: http://developer.mbed.org/users/mbed_official/code/mbed-src/file/098575c6d2c8/targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/spi_api.c.

What you can do is use a software SPI, which can't reach the speed the hardware SPI can reach, but it will work on any pin: http://developer.mbed.org/users/davervw/code/SWSPI/

Accepted Answer

Thanks Erik that is exactly what I was trying to find!

Now is there a way I can edit this to include the pins I need?

posted by Jimi Minton 03 Oct 2014

No. The microcontroller simply does not have the hardware to connect its SPI units to those pins. It is not possible. Either you need to use other pins, or emulate SPI in software.

posted by Erik - 03 Oct 2014