0
votes

I am using an A-Star 32U4 Micro Arduino and I'm trying to connect the RDM6300 - 125KHz Cardreader Mini-Module.

I'm using this sketch at the moment:

#include <SoftwareSerial.h>

// RFID  | Nano
// Pin 1 | D2
// Pin 2 | D3
SoftwareSerial Rfid = SoftwareSerial(2,3);

void setup() {
  // Serial Monitor to see results on the computer
  Serial.begin(9600);
  // Communication to the RFID reader
  Rfid.begin(9600);
}

void loop() {
  // check, if any data is available
  if(Rfid.available() > 0 ){
    // as long as there is data available...
    while(Rfid.available() > 0 ){
      // read a byte
      int r = Rfid.read();
      // print it to the serial monitor
      Serial.print(r, DEC);
      Serial.print(" ");
    }
    // linebreak
    Serial.println();
  }
}

With this circuit:

  • module TX --- Arduino pin 2
  • module VCC ----- 5v
  • module ground ---- ground
  • antenna pins ---- antenna

When I put the card in the sensor nothing shows up on serial port. I tried this setup and the exact same sensors on an Arduino Uno (same sketch) and it worked perfectly, but I cant get this working on the Micro.

1
Why use software serial if you have hardware serial available?gre_gor
how can i use it?1cybersheep1
Hardware serial (pins 0 and 1) is accessible with Serial1.gre_gor

1 Answers

1
votes

Arduino UNO and Micro uses different processors, though they work fairly similarly, they are not totaly identical.

It seams that

not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

From the SoftwareSerial Library description ( https://www.arduino.cc/en/Reference/softwareSerial )

Change the module TX from pin 2 to pin 8. and you should be good. :-)