RC522 arduino module

Hello, this is my very first ask in this forum, just to the point, i wanna using rc522 but using library is too easy and i cant learn something new with just learning using library, so i decided to using rc522 and code it without library, but i getting confused because why my code not work even i though it should be work fine, and i have been try with module too and its can its mean the wire is right already, and when i use my code that is not work, here is my code:

#include <SPI.h>

int RFIDsda = 2, RFIDsck = 13, RFIDmosi = 11;
int RFIDmi = 12, RFIDrst = 3;
byte RegFifoData = 0x09, RegFifoLevel = 0x0a;
byte RegCommand = 0x01, RegBitFraming = 0x0D;
byte RegFIFOLevelReg = 0x08, RegTxControl = 0x14;

void RFIDreset() {
  digitalWrite(RFIDrst, LOW);
  delay(5);
  digitalWrite(RFIDrst, HIGH);
}
void RFIDsend(byte reg, byte data) {
  digitalWrite(RFIDsda, LOW);
  SPI.transfer((reg << 1) & 0x7E);
  SPI.transfer(data);
  digitalWrite(RFIDsda, HIGH);
}
byte RFIDread(byte reg) {
  digitalWrite(RFIDsda, LOW);
  SPI.transfer(((reg << 1) & 0x7E) | 0x80);
  byte val = SPI.transfer(0x00);
  digitalWrite(RFIDsda, HIGH);
  return val;
}
void RFIDgetCard() {
  RFIDsend(RegCommand, 0x00);    // Idle
  RFIDsend(RegFifoLevel, 0x80);   // Flush FIFO
  RFIDsend(RegBitFraming, 0x07);  // 7 bits utk REQA
  RFIDsend(RegFifoData, 0x26);    // REQA
  RFIDsend(RegCommand, 0x0C);     // Transceive

  while (RFIDread(RegCommand) & 0x1F); // tunggu selesai

  byte error = RFIDread(0x06); // ErrorReg
  if (error != 0) {
    Serial.print("Err: ");
    Serial.println(error, HEX);
    return; // ga usah baca FIFO
  }

  byte level = RFIDread(RegFifoLevel);
  if (level > 0) {
    Serial.print("Ada kartu! FIFO: ");
    Serial.println(level);
    for (byte i = 0; i < level; i++) {
      Serial.print(RFIDread(RegFifoData), HEX);
      Serial.print(" ");
    }
    Serial.println();
  } else {
    Serial.println("Ga ada kartu.");
  }
}


void setup() {
  pinMode(RFIDsda, OUTPUT);
  pinMode(RFIDrst, OUTPUT);
  digitalWrite(RFIDsda, HIGH); digitalWrite(RFIDrst, HIGH);

  SPI.begin();
  Serial.begin(250000);
  RFIDsend(RegCommand, 0x0F); // Soft reset
  delay(50);
  RFIDsend(RegTxControl, 0x83);
  RFIDsend(RegCommand, 0x00);
  RFIDreset();
  RFIDsend(RegTxControl, 0x83); // antena nyala setelah reset
}
void loop() {
  
  RFIDgetCard();
  delay(300);
  Serial.print("ErrorReg: "); Serial.println(RFIDread(0x06), HEX);
  Serial.print("Status2: "); Serial.println(RFIDread(0x09), HEX);

}```

I don't see any debug output to work with.
As far as using a library is concerned, I have been programming since 1959 and if I have a library I can use I will.
Good luck.

Nonsense.

If the setup works with the library, the modules are functioning and the wiring is correct.

Then you can go off, write your own code and "learn something".

Your "write to register"...

... does not look like the library's "write value to register"

void MFRC522::PCD_WriteRegister(	PCD_Register reg,	///< The register to write to. One of the PCD_Register enums.
									byte value			///< The value to write.
								) {
	SPI.beginTransaction(SPISettings(MFRC522_SPICLOCK, MSBFIRST, SPI_MODE0));	// Set the settings to work with SPI bus
	digitalWrite(_chipSelectPin, LOW);		// Select slave
	SPI.transfer(reg);						// MSB == 0 is for writing. LSB is not used in address. Datasheet section 8.1.2.3.
	SPI.transfer(value);
	digitalWrite(_chipSelectPin, HIGH);		// Release slave again
	SPI.endTransaction(); // Stop using the SPI bus
} // End PCD_WriteRegister()

Read the MFRC522 library and learn from it. GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522

while (RFIDread(RegCommand) & 0x1F); // Wait until done

This Transceive Wait loop can hang.
You can try this instead.

unsigned long start = millis();
while ((RFIDread(CommandReg) & 0x1F) && (millis() - start < 500)); // 500ms timeout

To confirm whether Transceive is done and successful, check bit 2 of CommIrqReg (0x04):

if (RFIDread(0x04) & 0x30) {
  // Bit 4: RxIRq, Bit 5: IdleIRq
}

Here is a simplified example of interfacing RC-522 with Arduino. You can see it. Interfacing of RFID RC522 with Arduino - The Engineering Projects

i was learning in arduino so i wanna learning more so that i know how its work, thx for you reply