Hello,
Is there somebody with a working SPI example ?
'Cause I try this simple code, but at the second spi reading, the board stop working!
unsigned int val;
void setup() {
// initialize digital pin
pinMode(CE, OUTPUT);
digitalWrite(CE,0);
//init serial
Serial.begin(115200);
//initialize SPI
SPI.begin();
}
void loop() {
delay(1000);
for(int i = 0;i<30;i++)
{
Serial.println("Start reading RTC");
delay(500);
}
//initialize spi transfert:
Serial.println("Init RTC");
SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE3));
Serial.println("Read RTC hour");
while(1)
{
Serial.println("#");
digitalWrite(CE,1);
delay(1);
SPI.transfer(0x92);
val = SPI.transfer(0x00);
delay(1);
digitalWrite(CE,0);
Serial.println(val);
delay(500);
}
You need to be a bit more specific what is not working?
Before we start, your sketch was incomplete and could not be compiled (missing CE and SPI header file include). But you used code tags in your post so forgiven. 
The code seems to be doing what it is supposed to do. I looped SPI MOSI to MISO and had a look at the signals with an oscilloscope. The signal looks fine. The SPI clock voltage is only 2.9V maybe because of the yellow LED connected to that line. That could be an issue with whatever your SPI slave needs and how long your wires are.
I also change the value send for the read to 0x5A so I can see the data line on the oscilloscope. And that is exactly what I get back.
19:59:11.211 -> 5A
19:59:11.720 -> #
19:59:11.720 -> 5A
19:59:12.191 -> #
Some other thing I noted
- The delay(1) for the CE line is a complete overkill. The transfer of a single byte takes less than 10 microseconds and the write and read together is over in 40 microseconds. With your delay the whole transmission takes 2.000 microseconds. You can remove the delay. There is still a 13 microsecond delay between the CE rising and the SPI clock starting. It reduces the complete transfer to 63 microseconds.