How to use the SPI on the Zero

Hi @sandeepmistry,

Thank you for your quick response, but i have another question.
Which pin I need to define for MISO, MOSI and SCK?

I found this in variants.cpp:

|SPI (Legacy ICSP) |
22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6]
| 2 | | 5V0 |
23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4]
24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5]
| 5 | | RESET |
| 6 | | GND

and I used this code to check with an oscilloscope the signals:

#include <SPI.h>

#define DATAOUT 23//MOSI
#define DATAIN 22//MISO
#define SPICLOCK 24//sck
#define SLAVESELECT 10//ss

void setup()
{

pinMode(DATAOUT, OUTPUT);
pinMode(DATAIN, INPUT);
pinMode(SPICLOCK,OUTPUT);
pinMode(SLAVESELECT,OUTPUT);
delay(10);

SPI.beginTransaction(SPISettings(3000000, MSBFIRST, SPI_MODE3));
digitalWrite(SLAVESELECT,HIGH); //release chip
}

void loop()
{
digitalWrite(SLAVESELECT, LOW);
SPI.transfer(0b00000110); //write enable
digitalWrite(SLAVESELECT, HIGH);
//delay(1);
digitalWrite(SLAVESELECT, LOW);
SPI.transfer(0b00000010); //write command

// Transfer memory address
SPI.transfer(0b00000000);
SPI.transfer(0b00000000);
SPI.transfer(0b00000000);

// Transfer value (byte)
SPI.transfer(0b01010101);
SPI.transfer(0b01010101);
SPI.transfer(0b11110000);
SPI.transfer(0b00001111);

digitalWrite(SLAVESELECT,HIGH);
//delay(1);
//SPI.endTransaction();
}

but i'm only able to see the slave select, do you have any idea why?

Thanks.