Git Product home page Git Product logo

Comments (7)

ljos avatar ljos commented on September 27, 2024

It says on the Leonardo ETH page that pin 10 is reserved for the Wiznet interface. I think you need to use a different SS pin.

from mfrc522.

inu-web avatar inu-web commented on September 27, 2024

Thanks for your reply
I already used the folllowing parts in my sketch to set SS to Pin 8 because of this fact, and also set Sd and Ethernet SS Pins to Output as I found in a topic in another place ...
But the "ReaderDetails" always shows "NFC Error" so it seems not to detect the reader via SPI (Version = FF or 00)

regards
Gerald

// SPI & RFID ----------
#include <SPI.h>
#include <MFRC522.h>
// ########## NFC Defs ##########
#define SS_PIN 8
#define RST_PIN 9

// NFC CREATE -------------
MFRC522 mfrc522(SS_PIN, RST_PIN); 

// setup
void setup() {
  // Open serial
  Serial.begin(9600);

  // CS-Lines for SD and Ethernet
   pinMode(4, OUTPUT);
   pinMode(10, OUTPUT);

    // RFID READER INIT -----
    SPI.begin();
    mfrc522.PCD_Init(); // Init RC522
    Serial.print(F("NFC:"));
    ShowReaderDetails(); // Show RC522 Card Reader details
}

// get details about RC522 hardware
void ShowReaderDetails() {
   // Get MFRC522 software version
   byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
   Serial.print(F("0x"));
   Serial.print(v, HEX);
   if (v == 0x91)
         Serial.print(F("=v1.0"));
    else if (v == 0x92)
          Serial.print(F("=v2.0"));
    else
           Serial.print(F("=v?.?"));
           Serial.println("");
          // When 0x00 or 0xFF is returned, communication probably failed
          if ((v == 0x00) || (v == 0xFF)) {
               Serial.println(F("NFC ERROR"));
      }
}

from mfrc522.

ljos avatar ljos commented on September 27, 2024

You don't seem to be using my library, but the miguelbalboa/rfid that mine is based on.

from mfrc522.

inu-web avatar inu-web commented on September 27, 2024

I am sorry, I used the library of miguelbalboa before and that doesnt work either
So i switched to your library ... why do you think I am using the other one?
Maybe I posted the wrong code ... Iยดll try again by using your library when I am back at home ... so long
thanks for your help and sorry if I bothered you!
regards
Gerald

from mfrc522.

ljos avatar ljos commented on September 27, 2024

I didn't mean to be brash. It is no bother. The reason I think you are using miguelbalboas library is that you are calling mfrc522.PCD_Init(). PCD_Init is not a method in my library.

from mfrc522.

konsgn avatar konsgn commented on September 27, 2024

Also, for troubleshooting communication issues, a logic analyzer is a very helpful tool.
This one is relatively inexpensive and quite powerful. also the java software supports decoding of common protocols.
http://www.seeedstudio.com/depot/Open-Workbench-Logic-Sniffer-p-612.html

hook up any analyzer to your lines and verify you are getting the appropriate responses expected from the MFRC522 datasheet.

from mfrc522.

inu-web avatar inu-web commented on September 27, 2024

Thanks a lot for your suggestions, I have an arduino based logic analyzer and already did some SPI-sniffing, but got stuck because of my lack of understanding the protocol.
I have to investigate a little more and also I have to test again with your library - have scrambled up my tests al ittle bit.
Sorry again for opening the issue here! Your help is highly appreciated.
Gerald

from mfrc522.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.