Multiple RFID (RDM6300) readers on Arduino MEGA

Hello everyone.

I am studying the example sketch of the RDM6300 and from it try to make two RDM6300 readers work together in the same arduino.

I researched a lot and I’m finding it difficult on some points:

I noticed that the problem is in SoftwareSerial, and that in some posts I’ve seen some people recommend using Serial1, Serial2 and Serial3, instead of SoftwareSerial. But I really did not understand how!

below I put two attempts I had to make it work. So if anyone can help, first tell me the best method, how to do it and where I am wrong.

thankful!

method 1

/*
  RFID RDM6300 data decoder library
 (c) Stephane Driussi 20150623
 Not for commercial use
 
 Refer to rdm6300_decoder_wiring.jpg diagram for proper connection
 
 */

#include <SoftwareSerial.h>
#include <RDM6300.h>
SoftwareSerial RFID1(68, 67); // RX and TX
SoftwareSerial RFID2(66, 65); // RX and TX

int Led=13;
uint8_t Payload[6]; // used for read comparisons

RDM6300 RDM6300(Payload);

void setup()
{
  pinMode(Led, OUTPUT);
  RFID1.begin(9600);    // start serial to RFID reader
  RFID2.begin(9600);    // start serial to RFID reader
  Serial.begin(9600);  // start serial to PC 
}

void loop()
{
  RFID1.listen();
  while (RFID1.available() > 0) 
  {
    digitalWrite(Led, HIGH);
    uint8_t c = RFID1.read();
    //Serial.print(c,HEX);
    if (RDM6300.decode(c)) {
      for (int i=0; i < 5; i++){
        Serial.print(Payload[i], HEX);
        Serial.print(" ");
      } 
      Serial.println();
    }  
  }
  RFID2.listen();
  while (RFID2.available() > 0) 
  {
    digitalWrite(Led, HIGH);
    uint8_t c = RFID2.read();
    //Serial.print(c,HEX);
    if (RDM6300.decode(c)) {
      for (int i=0; i < 5; i++){
        Serial.print(Payload[i], HEX);
        Serial.print(" ");
      } 
      Serial.println();
    }  
  }
  digitalWrite(Led, LOW);   
  delay(100);
}

method 2

/*
  RFID RDM6300 data decoder library
 (c) Stephane Driussi 20150623
 Not for commercial use
 
 Refer to rdm6300_decoder_wiring.jpg diagram for proper connection
 
 */

#include <SoftwareSerial.h>
#include <RDM6300.h>
SoftwareSerial RFID1(68, 67); // RX and TX
SoftwareSerial RFID2(66, 65); // RX and TX

int Led=13;
uint8_t Payload[6]; // used for read comparisons

RDM6300 RDM6300(Payload);

void setup()
{
  pinMode(Led, OUTPUT);
  Serial1.begin(9600);    // start serial to RFID reader
  Serial2.begin(9600);    // start serial to RFID reader
  Serial.begin(9600);  // start serial to PC 
}

void loop()
{
  while (Serial1.available() > 0) 
  {
    uint8_t c = RFID1.read();
    //Serial.print(c,HEX);
    if (RDM6300.decode(c)) {
      for (int i=0; i < 5; i++){
        Serial.print(Payload[i], HEX);
        Serial.print(" ");
      } 
      Serial.println();
    }  
  }
    while (Serial2.available() > 0) 
  {
    uint8_t c = RFID2.read();
    //Serial.print(c,HEX);
    if (RDM6300.decode(c)) {
      for (int i=0; i < 5; i++){
        Serial.print(Payload[i], HEX);
        Serial.print(" ");
      } 
      Serial.println();
    }  
  }
  digitalWrite(Led, LOW);   
  delay(100);
}

Can you show me, with whatever diagram you have, where pins 65, 66, 67 and 68 are? You're not using an Arduino Mega 2560 as chip pins 65-69 are not terminated.

Regardless, why not follow the advice already given and use the on-board peripherals? You use the other serial ports all the same, just attach the number to the name.

Hello. Thank you for caring about my problem.

68 is A14
67 is A13
66 is A12
65 is A11

this diagram works if you use the isolated RDM6300 modules, but when I try to use them together, I'm not successful. I do not understand if it is programming error.

You might try using the An reference (A65 …) as the pin mapping in SoftwareSerial may not be complete. Anyhow, I’m not a big fan of SoftwareSerial and as I decline to use it, so I must advise others. If you need help with programming the hardware, fine, otherwise from my perspective you’re on your own. Good Luck.

I did not understand. Are you saying there is no way to put two RDM6300 with the mega?

I'll say it again (and for the last time) and as others have indicated, ditch the library and use the on-board uarts.

Somsbody could help?