Use of ICSP connection as SPI slave in a Arduino Zero sketch

Hi all,

I’d like to use the ICSP port as spi slave in a sketch, is it possible use it?

I have downloaded a library (SercomSPISlave) released and tested on Zero, but seems not present the correct pins. It seems that the pins used belong at different SERCOM (from schematic https://cdn-shop.adafruit.com/product-files/2843/Arduino-Zero-schematic.pdf):
MISO: PA12
MOSI: PB10
SCLK: PB11

but in library we have:

class Sercom4SPISlave {
….
enum MOSI_Pins {PA12, PB08, PB12}; < — PA12 MISO not MOSI
enum SCK_Pins {PA13, PB09, PB13}; < — not present PB11
enum MISO_Pins {PA15, PB11, PB15}; < — not present PB10

I use a wrong schematic or I will have to change the library for support Zero described up ?

Cheears,
Dario

Yes you can use the ICSP pins but beyond that I cannot follow what you are doing. Since you can read schematics post a simple one showing exactly how you connected it. MOSI goes to MISO always. SCK to SCK. Do not forget about CS\ chip select if it is not true it will not work.

Hi,
thank you for your answer.

In this moment we use an Arduino Zero, the sketch should to use 5 SPIs (one master and 4 slaves) one spi slave we will use as port communication with another SAM (V71), in real board we want use the version ATSAMD21J17 RT version (64 pin) that should to be support all the SPIs. Than some pin are busy for other functionalities (GPIO. console, 6PWM, etc) than we must to use the ICSP connection.

The question is the pin mismatch HW/SW.

Cheers.
Dario

You can use one SPI bus for several devices, 4 or 5 would be no problem. You can use a 74HC138 or similar device for a mux which would only require 3 pins for device select and the original CS\ as the enable. You might want to breadboard it first.