MOD-RFID1356MIFARE and ESP32-EVB

Started by atp, April 16, 2020, 04:10:02 PM

Previous topic - Next topic

atp

Hello,

We are interested in your ESP32-EVB board for a project which requires Ethernet, SD card and RFID reader.
We noticed that you have a "MOD-RFID1356MIFARE" that we can plug through an UEXT connector to the ESP32-EVB board.
The problem is that when we will connect this module to the board, the RX pin will be connected to the GPIO4 and the TX pin will be connected to the GPIO36. Both GPIO are not considered as hardware UART for the ESP32. Indeed, the ESP32 has 3 UART: (3;1) for the USB, (9;10) for the Flash and (16;17) which is free to use. We want to use this last one to control our RFID module.
Thus, we have thought about 2 solutions:

1)      Have a custom UEXT cable which invert the pins 3->10 and 4->5. Do you know where we can buy that type of cable?

2)      Is it possible for you to change the place of the pins 3->10 and 4->5 in your ESP32-EVB? (Example below)


LubOlimex

#1
You can define any GPIO for UART.

It is defined for the OLIMEX board as

#define TX1 4
#define RX1 36

Here: https://github.com/espressif/arduino-esp32/blob/master/variants/esp32-evb/pins_arduino.h
Technical support and documentation manager at Olimex

atp

Thank you for your response.

I know that we can define any GPIO for UART but I don't think the PN532 library works with a SoftwareSerial. I have an ESP32 and a PN532 with me and here are my tests:

//////////////////////////////////////////////////////////////////////////////////////////

1)      First test: With a Hardware Serial (GPIO 16 and 17), it works perfectly!

#include <PN532_HSU.h>
#include <PN532.h>

PN532_HSU pn532hsu(Serial2);
PN532 nfc( pn532hsu );

void setup(void) {
nfc.begin();
}

library:

-          PN532_SWHSU: https://github.com/elechouse/PN532

//////////////////////////////////////////////////////////////////////////////////////////

2)      Second test: With a Software Serial (GPIO 36 and 4), it doesn't work (Didn't Find PN53x Module)

#include <SoftwareSerial.h>
#include <PN532_SWHSU.h>
#include <PN532.h>

SoftwareSerial SWSerial( 36, 4 ); // RX, TX
PN532_SWHSU pn532swhsu(SWSerial);
PN532 nfc( pn532swhsu );

void setup(void) {
nfc.begin();
}

Libraries:

-          SofwareSerial: https://github.com/plerup/espsoftwareserial/

-          PN532_SWHSU: https://github.com/elechouse/PN532

//////////////////////////////////////////////////////////////////////////////////////////

Do you use another library for SoftSerial or for your PN532 module?

LubOlimex

I mean you can define any free GPIO pin as hardware UART. You don't need to use software serial.
Technical support and documentation manager at Olimex