Hey everyone,
I'm currently working with a MFRC522 for a project, and i'm having a weird wiring issue. If I use a 22awg 6 conductor wire to power and communicate with the MFRC522, everything works. If I split the power in another 22awg 2 conductor wire without changing anything else (same MFRC522, exact same power bus, exact same code, same RFID tag) the MFRC522 just won't work anymore. It initializes but won't read or write. We're trying to split the connections in a 2 conductor and a 4 conductor (2+4 = 6) to allow a better cable management. Do you guys have any idea? Here's my code:
#include <Arduino.h>
#include <MFRC522.h>
#include <RFID.h>
#include <Config.h>
void writeRFID();
void readRFID();
void setup() {
Serial.begin(9600);
RFID_init(rfid_sda_pin);
Serial.println("setup done");
readRFID();
}
void loop() {
// put your main code here, to run repeatedly:
}
void writeRFID()
{
uint16_t NumCassette = 1325;
Serial.println(NumCassette);
while (!RFID_write_ID(NumCassette))
;
Serial.print("wrote successfully : ");
Serial.println(NumCassette);
}
void readRFID()
{
byte dataWritten[ID_LENGTH];
int i = 0;
while (!read_chip(mIdPage, ID_LENGTH, dataWritten, false))
{
delay(500);
}
uint16_t combinedValue = ((uint16_t)dataWritten[1] << 8) | dataWritten[0];
Serial.print("Read : ");
Serial.println(combinedValue);
}