I have successfully connected an UNO to a Wiznet board (WIZ811MJ) using SPI and it works, but I need it to work on my Arduino Micro. The difference is that the Micro has dedicated pins for SPI, whereas the UNO doesn’t. So, my question is: Is the SPI.h library implemented the same for either board, or do I need to do more coding to make it work? For example, on the UNO, pin 10 is used for SS (slave select), but the Micro has a dedicated SS pin. For the Micro, do I need to set SS as an output? Anything else I need to do?
Both boards use a '328 chip, yes? Then both support SPI exactly the same. SCK on D13, MISO on D12, MOSI on D11, and SS on D10. SS must be an output to be SPI Master. Any other pin can also be used for a slave select after D10 is set as an output.
CrossRoads, the Arduino Micro is a miniature Arduino Leonardo.
The SPI hardware inside the ATmega32u4 is the same as in the ATmega328P. I think you have to set the SS pin as output to make it work.
This is how you could use it, http://openenergymonitor.blogspot.nl/2012/06/arduino-leonardo-atmega32u4-and-rfm12b.html There seems to be a problem, https://github.com/arduino/Arduino/issues/931
Ah, so similar but not quite the same. Yes, SS needs to be an output to be SPI master either way.
I had the same issue and couldn't find a way to define the SS pin from the Micro as the SS of the SPI library. Ended up using pin 4 (as it's the one in the example) but you can use any other if you want.
If someone knows how to reference the SS pin I would like to know for future projects, but in the mean time my advice is to simply use a digital output as your SS.
Follow up if anyone is still listening to this thread...
@cgirongu are you saying you were not able to use the hardware SS pin but were able to get it working with another available pin?
I'm looking at a similar issue, I can call the pin as "SS" in code and it will compile but it does not seem to be working.