Olimex Support Forum

Others => UEXT => Topic started by: mactronica on June 30, 2020, 08:16:48 PM

Title: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: mactronica on June 30, 2020, 08:16:48 PM
Dear,
i use your MOD-RFID1356MIFARE in some application and it is a great product but unfortunaly non open source. I have some issues about fixed baud rate in UART mode. 38400 is not a great speed but i need to lower down to 9600 since NFC badge reading is a slow application. In 38400 i exeperienced lower signal integrity. Could you implement a command to set baudrate in UART mode or a firmware version with 9600 speed default?
Thank you in advance
Cheers,
Giuseppe
Title: Re: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: LubOlimex on July 01, 2020, 08:33:31 AM
I am trying to understand here. What is the reason that you want to lower the baud? Do you think lowering the baud would increase the distance or improve the reliability?
Title: Re: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: mactronica on July 02, 2020, 10:16:14 AM
"improve the reliability".
I have just 10cm of IDC cable from ESP32-EVB board to MOD-RFID1356MIFARE.
Here i'm using ESP32 Arduino framework sending command by
HardwareSerial RFIDScanSerial(1);
RFIDScanSerial.begin(38400, SERIAL_8N1, PIN_RX1_RFID, PIN_TX1_RFID);

RFIDScanSerial.println("ew0,AABBCCDD");

and reading by
static String MOD_MIFARE_Text_Output="";

if (RFIDScanSerial.available ()  > 0)
{
    MOD_MIFARE_Text_Output=" ";
    while (RFIDScanSerial.available() > 0)
    {
      MOD_MIFARE_Text_Output += (char)RFIDScanSerial.read();
    }
}


Title: Re: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: Brian on July 02, 2020, 02:05:55 PM
This sketch work perfectly for me:


#include <Arduino.h>
HardwareSerial RFIDScanSerial(1);

#define PIN_RX1_RFID 36
#define PIN_TX1_RFID  4
void setup() {
  // put your setup code here, to run once:
RFIDScanSerial.begin(38400, SERIAL_8N1, PIN_RX1_RFID, PIN_TX1_RFID);
Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  static String MOD_MIFARE_Text_Output="";
 
  if (RFIDScanSerial.available ()  > 0)
{
    MOD_MIFARE_Text_Output=" ";
    while (RFIDScanSerial.available() > 0)
    {
   char l = (char)RFIDScanSerial.read();
    if (l == 10){
        Serial.println( MOD_MIFARE_Text_Output);
        MOD_MIFARE_Text_Output = "";

    } else
      MOD_MIFARE_Text_Output += l;
    }
}
}

Tested on ESP32-EVB and MOD-RFID1356Mifare connected with 30cm uext to uext cable.
 
Title: Re: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: mactronica on July 06, 2020, 12:00:05 AM
Thank you Brian for your reply.
Your code read from MOD-RFID.
Do you have a reliable example to send command to it?
Often writing by Serial.print("ew6,AABBCCDD\n\r") or Serial.write() i got
ERR:0x07

Giuseppe
Title: Re: MOD-RFID1356MIFARE UART 9600 Baud Rate
Post by: Brian on July 06, 2020, 09:29:05 AM
You have to use
Serial.println("ew6,AABBCCDD") instead. Without "\r\n".