Information Center for ARM

Example description

  
    
Overview
========
This example is a reference application to demonstrate how to use SPI
master API to communicate with an SPI slave with two LinkIt 2523 HDKs
(master project)

The example project has two parts: 
    1. LinkIt 2523 HDK operates as SPI Master device (spi_master_to_slave). 
    2. LinkIt 2523 HDK operates as SPI Slave device (spi_slave_from_master)

-This example does not require FreeRTOS

Hardware requirements
=====================
- LinkIt 2523 HDK
- Personal Computer
- Type-A to micro-B USB

Board settings
==============
The communication between master and slave devices is shown below:
       _________________________                       __________________________
      |           ______________|                     |______________            |
      |         |SPI Master     |                     |     SPI Slave|           |
      |         |               |                     |              |           |
      |         CON6301 Left.6  |_____________________|CON6301 Left.6            |
      |         |               |                     |              |           |
      |         CON6301 Left.7  |_____________________|CON6301 Left.7            |
      |         |               |                     |              |           |
      |         CON6301 Left.8  |_____________________|CON6301 Left.8            |
      |         |               |                     |              |           |
      |         CON6301 Left.9  |_____________________|CON6301 Left.9            |
      |         |_______________|                     |______________|           |
      |                         |                     |                          |
      |                         |                     |                          |
      |                      GND|_____________________|GND                       |
      |                         |                     |                          |
      |_MT2523__________________|                     |_MT2523___________________|


Prepare the Demo
================
1.  Connect a micro USB cable between the host PC and the MK20 USB port on the target master board (the board for the master example).
2.  Build this project and Download it to the target master board (the board for the master example).
3.  Connect a micro USB cable between the host PC and the MK20 USB port on the target slave board (the board for the slave project).
4.  Build the slave project (spi_slave_to_master) and Download it to the target slave board (the board for the slave example).
5.  Connect the two boards as shown in "Board settings"
6.  Open a serial terminal with the following settings for the master board:
    - 115200 baud rate
    - 8 data bits
    - No parity
    - One stop bit
    - No flow control

Running the demo
================
1. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

The log of "spi_master_send_data_two_boards_example ends" for
master board and "spi_slave_receive_data_two_boards_example ends" for
slave board indicates a successful communication. 

IMPORTANT
==========
Please make sure the two LinkIt 2523 HDK boards (Master and Slave) are powered up at the same
time, no more than 2 seconds apart
    
Customization options
=====================