Never used SPI before between Arduino's before, have only used I2C.
Basically I have a atMega2560 talking over SPI to 3x atTiny84's.
Ignore the type of micros, I just am trying to get my head around the code to do what I want.
Basically, I want the 2560 to be the master, and to request data from each of the atTinys.
Each atTiny has a seperate Chip Select going to it from the Master.
Looking at the SPI library, SPI - Arduino Reference , there doesnt seem to be much in there....
So basically after I set up who is master and who is slave, set the speed etc, is it just a case of doing the transfer() ?
I am searching more, but thought I would post incase someone knows how to do this. I am just wanting to set up a quick test program to prove the point. atTiny does stuff and then when requested from the 2560, it will give up a value. Job done.
In file included from Brick_Tiny_Functions.cpp:1:
D:\Projects\Arduino-0022\libraries\SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:56: error: 'SPDR' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:57: error: 'SPSR' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:57: error: 'SPIF' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:63: error: 'SPCR' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:63: error: 'SPIE' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:67: error: 'SPCR' was not declared in this scope
D:\Projects\Arduino-0022\libraries\SPI/SPI.h:67: error: 'SPIE' was not declared in this scope
Brick_Tiny_Functions.cpp: In function 'void setup()':
Brick_Tiny_Functions:8: error: 'SPCR' was not declared in this scope
Brick_Tiny_Functions:8: error: 'SPE' was not declared in this scope
Brick_Tiny_Functions.cpp: In function 'void loop()':
Brick_Tiny_Functions:16: error: 'SPDR' was not declared in this scope
Brick_Tiny_Functions.cpp: In function 'byte slave()':
Brick_Tiny_Functions:22: error: 'SPSR' was not declared in this scope
Brick_Tiny_Functions:22: error: 'SPIF' was not declared in this scope
Brick_Tiny_Functions:23: error: 'SPDR' was not declared in this scope
Ha - yeah.
Now I just need to fully understand why it is working and how to make it better!
These are going to be doing high speed counting so I need to make sure that what I have there isnt blocking, which I am thinking it might be with that while loop...