Promila 0 Posted February 1, 2014 Share Posted February 1, 2014 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 Quote Link to post Share on other sites
Promila 0 Posted February 1, 2014 Author Share Posted February 1, 2014 Please ignore my message, got it working now. Thanks for the library !! Quote Link to post Share on other sites
tobydjones 1 Posted May 28, 2015 Share Posted May 28, 2015 I'm also just getting status 2, can you tell me how you fixed that please?! Quote Link to post Share on other sites
RROMANO001 6 Posted June 1, 2015 Share Posted June 1, 2015 I'm also just getting status 2, can you tell me how you fixed that please?! Hi Tod, please can you specify which Library, board are you using and how it is setup hardware too., Quote Link to post Share on other sites
tobydjones 1 Posted June 1, 2015 Share Posted June 1, 2015 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 Quote Link to post Share on other sites
tobydjones 1 Posted June 1, 2015 Share Posted June 1, 2015 Ah-ha, found the 'full editor'. Here's my hardware setup. Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 Ah-ha, found the 'full editor'. Here's my hardware setup. Try remove the jumper P1.6 on led, this disturb I2C/SPI communication then tell me about result. Also SDA and RST (red and Gray wire) seems reversed. Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 Code is the 'cardreader' example from library Mfrc522.zip created by eelcor, found here. Toby Hi Toby, this is also pointing to banggood, please can you adjust to point to library source? Quote Link to post Share on other sites
tobydjones 1 Posted June 2, 2015 Share Posted June 2, 2015 Sorry, the library is Mfrc522.zip from this post. Happy to use something else if there's a different library out there. I detatched P1.6, but it didn't help. I swapped SDA & RST but still get an error Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 Sorry, the library is Mfrc522.zip from this post. Happy to use something else if there's a different library out there. I detatched P1.6, but it didn't help. I swapped SDA & RST but still get an error same error 2 SPI error? Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 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? Quote Link to post Share on other sites
tobydjones 1 Posted June 2, 2015 Share Posted June 2, 2015 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! Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 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; Quote Link to post Share on other sites
tobydjones 1 Posted June 2, 2015 Share Posted June 2, 2015 on each call to the library, either: status in library = 2 backbits = 11 status in library = 2 backbits = 61016 Quote Link to post Share on other sites
RROMANO001 6 Posted June 2, 2015 Share Posted June 2, 2015 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.