November 22, 2024, 11:12:00 PM

MOD-RFID1356MIFARE UART 9600 Baud Rate

Started by mactronica, June 30, 2020, 08:16:48 PM

Previous topic - Next topic

mactronica

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

LubOlimex

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?
Technical support and documentation manager at Olimex

mactronica

"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();
    }
}



Brian

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.
 

mactronica

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

Brian

You have to use
Serial.println("ew6,AABBCCDD") instead. Without "\r\n".