zodier / MFRC522-UART-Arduino

Arduino library for MFRC522 based modules via UART interface.
MIT License
25 stars 15 forks source link

Does this code even works? #3

Open Himura2la opened 7 years ago

Himura2la commented 7 years ago

I'm trying to understand how should I talk to this chip via UART and one evening was not enough for this. I have a question. Where does the 0xAB came from?

As I see in the datasheet, to read a register you should just send its address in 9600/8-N-1 mode (10bit package). There's no register with ABh address there, and other addersses like 0x02 - 0x04 are about interrupts, that looks strange.

Where is this from?

    write(MFRC522_HEADER);      // Header
    write(sendDataLength);      // Length (Length + Command + Data)
    write(command);             // Command

I can't understand what do you send and why should it work. Also, I don't see the serial number request, why do you expect the chip sends it on init? It does not in my case ((