PlatformIO Community

Help with undersatnding SPI slave setup on avr4809

I read the avr4809 datasheet about SPI transfers and it seems it’s a native 8 bit operation as you’d expect I guess.

I want to transfer a 16 bit integer from one 4809 chip to another 4809 chip. I’ve included the Arduino SPI.h header and just looking in there it seems I can do SPI.transfer16 which is useful.

My question is how do I set up the 4809 in SPI slave mode?

I found some code examples which suggest

  // turn on SPI in slave mode
  SPCR |= bit (SPE);

But I don’t really know what this means after having explored the expansions of SPCR, bit and SPE

Could anyone point me in the right direction?

thanks for any help.

no probs, I have a master and slave setup working with two mega2560 boards, one set as master and the other as slave. I’m successfully transferring a 16 bit uint from slave to master.
I’ll post some code once I’ve tested a bit more.