Needed help in SPI communication between two arduino due (ATSAM3x8EA chip)

Hi everyone,
I am working on one project for that i need help on spi communication between two Arduino due board, my problem is that i am not able to send and receive data. On master Serial monitor only i am seeing 255.

Even on digital oscilloscope i am not seeing clock pulse even after enabling CS pin and loading data using SPI.transfer function. Here i am attaching my code for master and slave. Any help please


SPI_Master.ino (389 Bytes)

SPI_Slave.ino (1.39 KB)

I use the DUE a lot but I don't use its unique SPI functions as most of my code also has to work on other Arduinos. So I'm not familiar with the version of SPI.begin() which takes the CS pin number.

I'd start by setting that pin as an OUTPUT first, though. The special CS pins are special because when you make them an input, the hardware automatically knows that it's a slave and isn't allowed to transmit without a master. All pins always start in INPUT mode.