hi i'm trying to connect pn532 to an ESP32 S2 MINI, the code works perfectly on arduino uno and nodemcu v1, i've already tried to set manually spi pins on SPI.begin(...).
Im using GPIO37 for MISO, GPIO35 for MOSI AND GPIO36 for SCK. I tried to move the CS between the pin of esp32 but isn't working.
My question is, am i using correct pins for SPI? if yes, is possible using SPI on ESP32 MINI S2?
I don't have that specific board but the SPI default should just work.
Can you post the whole sketch ?
That may not work if the library used doesn't account for that method, also the library used may not be quite compatible with your board in it's SPI pins definition.
Maybe the default pin nrs for SPI on an AVR & ESP8266 are used. Show us the code and a link to the github of the library used
I'm bulding code by myself, as i already say, library works fine with esp8266, esp32 DEVKIT and Arduino Uno. I think is only a problem of hardware, seems at this point that esp32 mini doesn't support SPI. For inizialize SPI i use SPI.begin(); without nothing passed as param.
Now i tried to input manually SCK,MISO,MOSI,CS in SPI.begin function.
If doesn't works, definetly ESP32 MINI S2 doesn't supports SPI.
Do you have this plugged into a breadboard?
That is why we need to see it.
Again this is why we need to see it.
It clearly states in the pinout that it does, and i am confident the datasheet will confirm that.
But if the library calls SPI.begin(), the pin assignments are again overwritten.
If you draw your own conclusions based on your experiences then why would you come here for help ?
Share your code, let us have a look, and draw conclusions together.
Solved the problem, now i let the correct pins i used for SPI:
SCK ---> GPIO 7
MISO ---> GPIO 9
MOSI ---> GPIO 11
CS ---> GPIO 12
VCC ---> 3v3
GND ---> GND
This configuration works perfectly. I left the code i used to identificate the SPI pins:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.print("MOSI: ");
Serial.println(MOSI);
Serial.print("MISO: ");
Serial.println(MISO);
Serial.print("SCK: ");
Serial.println(SCK);
Serial.print("SS: ");
Serial.println(SS);
}
void loop() {
// put your main code here, to run repeatedly:
}
Even better to share the whole code. Happy you can go on with your project.
sorry if I didn't share it but I already knew that it was a configuration error of the SPI library as it already ran on multiple microcontrollers.
Thanks everyone for the help, you are a good community.
Can you please share your whole code, i have spent days trying to get spi working on my S2 with no avail, even if you didnt want to make it open send it to me directly? Really appreciate it
have you ran the posted code, and initialized SPI lib with printed pins in Serial Monitor?
yea it was pins 10 11 etc etc, I ended up finding another post along the lines of writing to an SD card with s2 mini breaks it, that spi code worked, abandoning the s2 mini anyway, thing crashes randomly and tells me the api request failed to send even though it does send it etc, just going to go back to connecting 2 d1 minis with serial
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.