Code for Aruduino mega 2560 as spi slave

Hi All,

I am new to Arduino. and I got new Arduino 2560. I want make it as SPI slave and connect to my FPGA.
Could some one guide me or share me the exiting code for making Arduino as slave.

regards
-Shiva

What did Mr Google say when you searched for Arduino SPI slave?

A good starting point is Nick Gammons SPI page here:

There's a specific topic on how to make an SPI slave.

It has been done but I am not privy to the code. The SPI library I have does not contain the code for slave mode of operation. For you to use Arduino as a Slave, you will need to do your own code unless you get lucky and find some. You will need to set the MISO as an output for your slave to send data to the master. After this you can enable slave mode by setting the SPCR register. Then you can enable interrupt when data is received or simply pole for it.

Try this link it would be a good starting point.

Great, thank you, I will look into it..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.