New to this, so please bear with me.
Trying to implement Due in SPI slave mode.
Have followed Nick Gammon's excellent article http://gammon.com.au/spi
This all works really well until I try porting the slave code to a Due. Compiling throws up a series of errors where SPCR SPE and others are undefined.
After doing a bit of digging, it would appear that SPI.h causes the chip to setup in master SPI mode, and that then certain register bits need to be written to turn it into a slave At least I think thats what this code is doing.
// turn on SPI in slave mode SPCR |= _BV(SPE);
However the register architecture on the due is different, according to the data sheet for the SamX3 there is a register called SPI_MR with a byte called MSTR which must be set 0 to enter Slave mode (its quite likely there are others I don't know about yet) Can someone explain the syntax required to do this regards Harry