Open smuehlst opened 4 years ago
I think you can use any pin. but,PB12 is used for TF_SS. PB0,1 is for LCD on Longan nano. so example, if you select PB11(B11) for SS, you would write :
SPIClass SPI(PB15, PB14, PB13, PB11);
@phillowcompiler It is clear to me that more or less any pin can be used for the Slave Select signal in my own code.
The issue is that the Arduino RFID Library for MFRC522 that depends on SPI expects the SS pin to be defined after including the SPI.h
header:
/**
* Constructor.
*/
MFRC522::MFRC522(): MFRC522(SS, UINT8_MAX) { // SS is defined in pins_arduino.h, UINT8_MAX means there is no connection from Arduino to MFRC522's reset and power down input
} // End constructor
I see😃 If so, can you try to modify "plarformio.ini"?
https://docs.platformio.org/en/latest/projectconf/section_env_build.html
If so, can you try to modify "plarformio.ini"?
Yes, I could do that, but my primary goal was to report this problem so it hopefully will be fixed sooner or later before an official release. An implementation of the Arduino SPI library will be useless or difficult to use if it doesn't implement the features that are expected by existing code...
I'm trying out the SPI library from the current master branch (as of commit e7e1d8ad04875813bea83edde82f99c7bb8f61d5) with the Arduino RFID Library for MFRC522, and the firstcompilation error that comes up is that there is no
SS
pin is defined.Apparently each Arduino implementation should declare a
SS
define that refers to the default pin to be used for the "Slave Select" signal. See https://www.arduino.cc/en/Reference/SPI.