Jump to content
43oh

Recommended Posts

http://www.aliexpres..._968016332.html


 


Hi !


 


 Please take a look at the above RFID card. I am getting a status of 2 after the MFRC522.Request. I think I am not doing some Pin connection incorrectly.  :(..  I am using Eelcor's port of the RC522 Mifare library.  I needed to finish this tonight but I am stuck.. I have tried connections based upon the pin connections above but does not seem to be working..  The NSS and the RST pins are the ones I am not sure if I am connecting correctly.


 


Thanks !!!!!


 


Promila


Link to post
Share on other sites
  • 1 year later...

Hi RROMANO001,

 

Thanks for being interested in my problem :)

 

I'm using a MIFAIR RC522 RFID reader from banggood. In fact I've tried two.

 

Code is the 'cardreader' example from library Mfrc522.zip created by eelcor, found here.

 

Pinouts:

// SDA  - 1.3
// SCK  - 1.5
// Mosi - 1.7
// Miso - 1.6
// IRQ  - NC
// GND  - GND
// RST  - 2.2
// VCC  - VCC
 
I haven't changed anything on the MSP-EXP430G2 card, so all the links are still 'on'. I'm powering it from a PC on USB.
When powered up, I get both LEDS on the Launchpad lit, and one red LED on the RC522 card.
The serial coms is working, so with some debug Serial.println I know it's looping. But when it gets to 'status = Mfrc522.Request(PICC_REQIDL, str);' it just returns 2, ie MI_ERR.
 
I'll post a photo of my hardware if I can work out how!
 
Toby
Link to post
Share on other sites

 Hi Toby, this is also pointing to banggood, please can you adjust to point to library source?

reading library pin used are:

int chipSelectPin = 10;

int NRSTDP = 5;

Mfrc522 Mfrc522(chipSelectPin,NRSTDP);

 

 So pinout where ok at first, Reset at pin 5 ->  P1.3 and CS (SDA) at pin 10 -> P2.2

 Not sure MISO MOSI are right connected... after a check on datasheet BG schematic appear as good, can you get access to a scope/Logic Analyser and show what happen on lines SCK MISO MOSI (use NSS as trigger) of SPI?

Link to post
Share on other sites

Yes, status is 2. It comes from:

 

status = Mfrc522.Request(PICC_REQIDL, str);

 

That status is checked against MI_OK. In Mfrc.h the definitions are:

 

//MF522 - Status
#define MI_OK                 0
#define MI_NOTAGERR  1
#define MI_ERR               2
 
So I've been assuming that the SPI communication is working correctly and the error message is coming from the board. I might be wrong!
Link to post
Share on other sites

 

Yes, status is 2. It comes from:

 

status = Mfrc522.Request(PICC_REQIDL, str);

 

That status is checked against MI_OK. In Mfrc.h the definitions are:

 

//MF522 - Status
#define MI_OK                 0
#define MI_NOTAGERR  1
#define MI_ERR               2
 
So I've been assuming that the SPI communication is working correctly and the error message is coming from the board. I might be wrong!

 

 Ok SPI seems ok, but please do a deeper step to see what answer chip:

 to point what happen in the library too, point to Request code than add print of vars (red comment)

 

unsigned char Mfrc522::Request(unsigned char reqMode, unsigned char *TagType)

{

    unsigned char status;   

    unsigned int backBits;

 

    WriteReg(BitFramingReg, 0x07);        //TxLastBists = BitFramingReg[2..0]    ???

    

    TagType[0] = reqMode;

    status = ToCard(PCD_TRANSCEIVE, TagType, 1, TagType, &backBits);

 

 // print status and backBits here

 

   if ((status != MI_OK) || (backBits != 0x10))

    {     

        status = MI_ERR;

    }

    

    return status;

 

Link to post
Share on other sites

 

on each call to the library, either:
status in library = 2 backbits = 11
status in library = 2 backbits = 61016

 

Seems bit are missing if decimal or one more if hexadecimal, second backBits is garbled but still err 2 is present so failure is lowest level

 error 2 came if flag is not ok and signal that:

//BufferOvfl Collerr CRCErr ProtecolErr

 

 this case are tag ok and correct type? Are just one card in front of reader? Is reader board crystal OK? Need some measure to assure board is ok, maybe a big shock on transportation damaged crystal or similar issue.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...