user19289: I am trying to get my Atmel SAMD11 XPLAINED PRO and arduino to talk to each other using SPI. I have set up the arduino as the master, with the SAMD11 as the slave. On the ATMEL, I have the following code:
http://asf.atmel.com/docs/latest/samd21/html/asfdoc_sam0_sercom_spi_slave_callback_use.html
Essentially, it waits until the master sends data, compares the data with what it expects, and updates an LED accordingly. On the arduino side, I have the following:
#include <SPI.h>

#define BUF_LENGTH 20
int slave_select = 10;

void setup (void)
{
  // Initialize serial for DEBUG.
  Serial.begin(9600);
  pinMode (slave_select, OUTPUT);
  digitalWrite(slave_select, HIGH);  // ensure SS stays high for now
  // Put SCK, MOSI, SS pins into output mode
  // also put SCK, MOSI into LOW state, and SS into HIGH state.
  // Then put SPI hardware into Master mode and turn SPI on
  SPI.beginTransaction (SPISettings (4000000, MSBFIRST, SPI_MODE0));  // 4 MHz clock, MSB first, mode 0
  // Master initialized.
  Serial.println("Master Initialized");
}  // end of setup

void loop (void)
{
  static uint8_t buffer_expect[BUF_LENGTH] = {
    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13
  };
  // enable Slave Select
  digitalWrite(slave_select, LOW);    // SS is pin 10

  //write the 20 bytes
  for (int I=0;I<20;I++)
  {
    SPI.transfer(buffer_expect[I]); //write data byte
    delay(20);
  }

  // disable Slave Select
  digitalWrite(slave_select, HIGH);

  delay (1000);  // 1 seconds delay 
}  // end of loop

When I run the code, the LED on the SAMD11 isn't updated, which means that it is waiting for data to be sent, and hasn't received any, despite what the arduino code writes. On the hardware side, I have GND connected on both boards, VCC on the SAM to 5V on the arduino, and SPI_SS_A, MOSI, MISO and SCK connected to pins 10,11,12 and 13 on the arduino respectively. 

user8166: You haven't set your SS pin as an output anywhere in your code.  
The arduino page you linked to has a note near the bottom which reads:  

Note about Slave Select (SS) pin on AVR based boards
All AVR based boards have an SS pin that is useful when they act as a
  slave controlled by an external master. Since this library supports
  only master mode, this pin should be set always as OUTPUT otherwise
  the SPI interface could be put automatically into slave mode by
  hardware, rendering the library inoperative. It is, however, possible
  to use any pin as the Slave Select (SS) for the devices. For example,
  the Arduino Ethernet shield uses pin 4 to control the SPI connection
  to the on-board SD card, and pin 10 to control the connection to the
  Ethernet controller.  

The Example code given for the teensy board on the other page you linked has:  
pinMode (slaveSelectPin, OUTPUT); 

in its setup() function.
So that's what you're missing.
Setting the pin high or low is not going to achieve anything if its not an output.  
Remember that SPI can access many diffrent devices using the same MOSI/MISO/SCK pins, but each slave device has its own Slave-Select pin which needs to be individually driven by the master.
Your master can therefore have many different SS pins, all set as outputs - and there is no single standard pin for this.

19289: <p>I am trying to get my Atmel SAMD11 XPLAINED PRO and arduino to talk to each other using SPI. I have set up the arduino as the master, with the SAMD11 as the slave. On the ATMEL, I have the following code:</p>

<p><a href="http://asf.atmel.com/docs/latest/samd21/html/asfdoc_sam0_sercom_spi_slave_callback_use.html" rel="nofollow">http://asf.atmel.com/docs/latest/samd21/html/asfdoc_sam0_sercom_spi_slave_callback_use.html</a></p>

<p>Essentially, it waits until the master sends data, compares the data with what it expects, and updates an LED accordingly. On the arduino side, I have the following:</p>

<pre><code>#include &lt;SPI.h&gt;

#define BUF_LENGTH 20
int slave_select = 10;

void setup (void)
{
  // Initialize serial for DEBUG.
  Serial.begin(9600);
  pinMode (slave_select, OUTPUT);
  digitalWrite(slave_select, HIGH);  // ensure SS stays high for now
  // Put SCK, MOSI, SS pins into output mode
  // also put SCK, MOSI into LOW state, and SS into HIGH state.
  // Then put SPI hardware into Master mode and turn SPI on
  SPI.beginTransaction (SPISettings (4000000, MSBFIRST, SPI_MODE0));  // 4 MHz clock, MSB first, mode 0
  // Master initialized.
  Serial.println("Master Initialized");
}  // end of setup

void loop (void)
{
  static uint8_t buffer_expect[BUF_LENGTH] = {
    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
     0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13
  };
  // enable Slave Select
  digitalWrite(slave_select, LOW);    // SS is pin 10

  //write the 20 bytes
  for (int I=0;I&lt;20;I++)
  {
    SPI.transfer(buffer_expect[I]); //write data byte
    delay(20);
  }

  // disable Slave Select
  digitalWrite(slave_select, HIGH);

  delay (1000);  // 1 seconds delay 
}  // end of loop
</code></pre>

<p>When I run the code, the LED on the SAMD11 isn't updated, which means that it is waiting for data to be sent, and hasn't received any, despite what the arduino code writes. On the hardware side, I have GND connected on both boards, VCC on the SAM to 5V on the arduino, and SPI_SS_A, MOSI, MISO and SCK connected to pins 10,11,12 and 13 on the arduino respectively. </p>
 8166: <p>You haven't set your SS pin as an output anywhere in your code.  </p>

<p>The arduino page you linked to has a note near the bottom which reads:  </p>

<blockquote>
  <p>Note about Slave Select (SS) pin on AVR based boards</p>
  
  <p>All AVR based boards have an SS pin that is useful when they act as a
  slave controlled by an external master. Since this library supports
  only master mode, this pin should be set always as OUTPUT otherwise
  the SPI interface could be put automatically into slave mode by
  hardware, rendering the library inoperative. It is, however, possible
  to use any pin as the Slave Select (SS) for the devices. For example,
  the Arduino Ethernet shield uses pin 4 to control the SPI connection
  to the on-board SD card, and pin 10 to control the connection to the
  Ethernet controller.  </p>
</blockquote>

<p>The Example code given for the teensy board on the other page you linked has:  </p>

<pre><code>pinMode (slaveSelectPin, OUTPUT); 
</code></pre>

<p>in its setup() function.</p>

<p>So that's what you're missing.<br>
Setting the pin high or low is not going to achieve anything if its not an output.  </p>

<p>Remember that SPI can access many diffrent devices using the same MOSI/MISO/SCK pins, but each slave device has its own Slave-Select pin which needs to be individually driven by the master.<br>
Your master can therefore have many different SS pins, all set as outputs - and there is no single standard pin for this.</p>
