nRF51 SDK - S210 SoftDevice
|
The SPI master Loopback Example is for demonstrating the SPI Master using a Loopback for verification. There are two ways to make the loopback complete: Either connect and configure a slave to transmit the received bytes or wire the MOSI and MISO pins of the SPI master together. Both SPI_MASTER_0 and SPI_MASTER_1 are tested in this example. It uses the hardware delivered in the nRF51822 Development Kit.
TX_RX_MSG_LENGTH number of bytes are transmitted through the master and the received bytes are verified to be the same as transmitted. If there is an error, the GPIO pin for the relevant SPI module is set high to show the error
If there is error from both modules, both pins go high and the application loops infinitely.
The application is started with configuring GPIO. Both SPI_MASTER_0 and SPI_MASTER_1 are tested, first with shifting lsb first, then by shifting msb first. If there is an error, the LED will be turned on.
Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).
If a slave is configured to transmit the received bytes:
Configuration for SPI_MASTER_0:
Configuration for SPI_MASTER_1:
If MOSI and MISO are connected together:
LED assignments:
The SPI master Loopback Example Application can be tested as follows: