Pages: [1]   Go Down
Author Topic: Mifare RFID-RC522  (Read 4767 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi...
I'm newbie to arduino.

I've got a Mifare RFID-RC522 reader -writer.
With some examples I found on the internet I managed to read the serial number of the cards, but ...
Anybody can explain like a fool how I can write and read data on the cards? or Where I can get examples to do?

Thanks in advance.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check this sketch: https://github.com/rena2019/myarduino/blob/master/RC522DumpMifare.ino
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Rena...
But this example is more complex for me.
Do not exist any library for read-write data more simple?

Greetings.
« Last Edit: October 10, 2013, 01:24:57 pm by Oso57 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


¿Nobody?   smiley-confuse
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


But this example is more complex for me.
Do not exist any library for read-write data more simple?

Greetings.
to complex? The sketch is a one-file-solution: the lib-functions to talk to the board are included, that's why it looks so complex.
You can replace the loop function with the following (untested) code:

void loop()
{
    uchar buffer[MAX_LEN];
    int block=0; //TODO: your block number
    if (selectCard(true) &&
         MFRC522_Auth(PICC_AUTHENT1A, block, defaultKeyA, serNum) == MI_OK &&
         MFRC522_Read(block, buffer) == MI_OK)
     {
            //TODO: block buffer contains the read data
     }
}

if you want to read 1 block only

     
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 63
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I've test the code and it's working.
i can read all block of the Token.

So, now the question is : can you explain the use of the function Auth,
we need to send defaultKeyA table, what is the content of the table ? what this table is it?

Thank you.
Timiti29
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello...

Thanks for your kindness

And to write?
I can not find the way

Greetings.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

And to write?
I can not find the way
Fill the buffer with the data you want to write and then use MFRC522_Write instead of MFRC522_Read from my sample code above (select,auth,write)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Thanks again for your kindness.


I am learning.

Greetings
Logged

Pages: [1]   Go Up
Jump to: