28byj-48 5V motors slow down when using MFRC522/SPI

I’m having some trouble with my motor at the moment.

I’ve tested both pieces of hardware independent of each other in different sketches and there is no issue there. For some reason when I use the reader with the motor, it slows the motor to a crawl. The motor alone works at whatever speed I set.

I’ve noticed in the past that using Serial and println-ing causes a slight delay in how quickly a loop completes(not with the motor, different project), but I would think that the operation driving the motor wouldn’t have any hindrance if it’s isolated to its own function with no interruptions. ’

Does utilizing SPI cause other problems?

void setup()
{
  SPI.begin();
  mfrc522.PCD_Init();
  runMotor = false;
}

void loop()
{
    stepperX.run();

    if(runMotor == true){
      stepperX.move(4096);
      runMotor  = false;
    }
   
    //Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }  
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial()) {
        return;
    }
    // Dump UID
    String rfid = "";
    for (byte i = 0; i < mfrc522.uid.size; i++) {
        rfid += mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ";
        rfid += String(mfrc522.uid.uidByte[i], HEX);
    }    
    rfid.trim();
    rfid.toUpperCase();
   
    if(rfid == rfid1 || rfid == rfid2){
        runMotor = true;
    }  
}

update:

The offending line of code, or all of it, seems to be

    //Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent()) {
        return;
    }

for reasons I don't understand, this is what causes motor problems. I can declare and initialize the MFRC522, but nothing goes wrong until I start reading to find a card.

How much time does the processor spend in mfrc522.PICC_IsNewCardPresent()?

And: is your power supply strong enough?

Erik_Baas:
How much time does the processor spend in mfrc522.PICC_IsNewCardPresent()?

And: is your power supply strong enough?

I suppose it is within that statement indefinitely until a card is found, according to the Serial.println I used to check.
Yes I believe my power is strong enough. It has no problem running without the _IsNewCardPresent() code being used