I'm trying to use an Arduino as a slave and was searching for examples which I found many. But apart from the examples, I haven't found any documentation explaining many thing that show up in those examples.

For example, I'd like a document that would state what things like the following are:

I'm asking this, because I don't and can't just copy an example and hope that it'll work, I really need to know what I'm doing.

Thank you,

  • you know, there is a SPI library?
    – Juraj
    Feb 8, 2018 at 12:02
  • Yes, I do know there's a library. But is there any document available that says what are the resources of that library? Feb 8, 2018 at 12:08
  • 2
    reference of he SPI library arduino.cc/en/Reference/SPI
    – Juraj
    Feb 8, 2018 at 12:19
  • 2
    Atmega datasheet ww1.microchip.com/downloads/en/DeviceDoc/…
    – Juraj
    Feb 8, 2018 at 12:24
  • Thank you very much, I'll look into the Atmega datasheet, didn't occur to me looking into it. Feb 8, 2018 at 15:10

2 Answers 2


You are confusing SPI, a de facto standard, with the Arduino/Atmel hardware support for SPI.

SPCR, SPE and SPDR are registers of the Atmel MCU, part of the hardware support.

ISR is Interrupt Service Routine and SPI_STC_vect is the vector that point to that code. That is where the data received from the cable is read finally.


Take a look at Nick Gammon's SPI explanations also. Very good, with timing explained as well.


  • His work is amazing, unfortunately he doesn't explain what those things are, apart from ISR and SPDR. And I had no idea from where the other things came. But there are already good answers that give me somewhere to look into. Thank you very much! Feb 8, 2018 at 15:09
  • I also explain SPI right here on this site: arduino.stackexchange.com/questions/16348/… - As for the register names, they are explained in the datasheet.
    – Nick Gammon
    Feb 8, 2018 at 20:32
  • Whilst I have a personal interest in the answer, it simply isn't practical to include or even summarize a lengthy post like an explanation of how SPI works. The OP is asking for documentation and this answer is giving a link to it. In my comment above I point out that there is more documentation available on this site which means it is less likely to go link-dead. Another answer might be to reference the datasheet, which again would have to be link-only, unless maybe you quoted a couple of pages.
    – Nick Gammon
    Feb 8, 2018 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.