I have an RDM6300 connected to an Arduino Mega and code that can read the tag just fine:
// Function prototypes
void setup(void);
void loop(void);
// RDM6300 packet details
#define RDM6300_PACKET_SIZE 14
#define RDM6300_PACKET_BEGIN 0x02
#define RDM6300_PACKET_END 0x03
// Globack for reading RFID data
char buff[RDM6300_PACKET_SIZE];
uint32_t tag_id;
uint8_t checksum;
void setup(void) {
Serial.begin(9600);
Serial.println("Setting up...");
// RFID board setup
Serial1.begin(9600);
Serial.println("READY. Scanning tags...");
}
void loop(void) {
while (Serial1.available() > 0) {
if (Serial1.peek() == RDM6300_PACKET_BEGIN || Serial1.read()) {
Serial1.readBytes(buff, RDM6300_PACKET_SIZE);
if (buff[13] != RDM6300_PACKET_END) {
Serial.println("Bad1");
}
else {
buff[13] = 0;
checksum = strtol(buff + 11, NULL, 16);
buff[11] = 0;
tag_id = strtol(buff + 3, NULL, 16);
buff[3] = 0;
checksum ^= strtol(buff + 1, NULL, 16);
for (uint8_t i = 0; i < 32; i += 8) checksum ^= ((tag_id >> i) & 0xFF);
if (checksum) {
Serial.println("Bad2");
}
else {
Serial.println(tag_id);
}
}
}
else {
Serial.println("Bad3");
Serial.println(Serial1.peek(), HEX);
}
Serial.println("END");
}
}
However, the output stops after reading the tag around 28 times sometimes (more, sometimes less...) . If I remove the tag from the "read" area and put it back on it start reading again for a number of times and then stop.
I have an LED connect to the RDM6300 board that is supposed to show when it detects a tag and it does blink while I hold the tag over the antenna but also stops when the Arduino stops receiving data.
As the RDM6300 is supposed to be a continuous RFID reader I was expecting to receive data for the duration I kept the tag over the antenna.
Anyone faced this same thing and found a solution ?
Thanks for any hints.