9 years, 9 months ago.

SPI on nRF51822

I noticed that spi.format in this particular board supports 8-bit only (line 175 of spi_spi.c)

Is it because of the cortex-m0 limitation or is it because the other formats are not yet supported by firmware?

If I wanted to read say 12 bits at a time, should I write my own software interrupt of the SPI or can I copy NXP's spi_spi implementation?

Thanks

Question relating to:

The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

1 Answer

9 years, 9 months ago.

It is most likely a limitation of the hardware. The m0 doesn't handle SPI, a seperate peripheral designed by the manufacturer, so in this case Nordic, handles SPI. I assume it is just only capable of 8-bit operation (it could be mbed lib, can't guarantee that). So NXPs implementation only works for that specific target.

For software emulation of the SPI peripheral, which should be almost as effective generally, look at: http://mbed.org/users/davervw/code/SWSPI/

Accepted Answer