NFC PN532 Module V3 Elechouse

Hello guys,

I'm totally new in this and I bought few days ago the NFC Module V3. On the other side i'm using an Arduino Micro from SParkfun Micro based on an ATmega32U4. I put in place libraries I uploaded sketches coming from elechouse and tried the first one so the read sketch.

My arduino recognize the chip unfortunatelly it keeps waiting until I put a card or a key card over it. Of course I do it but nothing happen. No recognition no sign from the arduino nothing....

Is there someone who had the same problem? or a beginning of an answer?

Thank you :slight_smile:

Result from UART:

Hello!
Found chip PN532
Firmware ver. 1.6
Waiting for an ISO14443A card
Timed out waiting for a card

Any news guys :)?

If you want more feedback try post your code and a link to the datasheet of the device your code is supposed to work with.

See paragraph 11 here: How to use this forum

Sure no prob:

Link of the how to: https://dangerousthings.com/wp-content/uploads/2013/12/PN532_-Manual_V3.pdf

I'm using the I2C connection.

Code:

/**************************************************************************/
/*! 
    This example will attempt to connect to an ISO14443A
    card or tag and retrieve some basic information about it
    that can be used to determine what type of card it is.   
   
    Note that you need the baud rate to be 115200 because we need to print
    out the data and read from the card at the same time!

    To enable debug message, define DEBUG in PN532/PN532_debug.h
    
*/
/**************************************************************************/

  #include <Wire.h>
  #include <PN532_I2C.h>
  #include <PN532.h>
  #include <NfcAdapter.h>
  
  PN532_I2C pn532i2c(Wire);
  PN532 nfc(pn532i2c);
  
void setup(void) {
  Serial.begin(115200);
  delay(10000);
  Serial.println("Hello!");

  nfc.begin();

  uint32_t versiondata = nfc.getFirmwareVersion();
  if (! versiondata) {
    Serial.print("Didn't find PN53x board");
    while (1); // halt
  }
  
  // Got ok data, print it out!
  Serial.print("Found chip PN5"); Serial.println((versiondata>>24) & 0xFF, HEX); 
  Serial.print("Firmware ver. "); Serial.print((versiondata>>16) & 0xFF, DEC); 
  Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
  
  // Set the max number of retry attempts to read from a card
  // This prevents us from waiting forever for a card, which is
  // the default behaviour of the PN532.
  nfc.setPassiveActivationRetries(0xFF);
  
  // configure board to read RFID tags
  nfc.SAMConfig();
    
  Serial.println("Waiting for an ISO14443A card");
}

void loop(void) {
  boolean success;
  uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };  // Buffer to store the returned UID
  uint8_t uidLength;                        // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
  
  // Wait for an ISO14443A type cards (Mifare, etc.).  When one is found
  // 'uid' will be populated with the UID, and uidLength will indicate
  // if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
  success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);
  
  if (success) {
    Serial.println("Found a card!");
    Serial.print("UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
    Serial.print("UID Value: ");
    for (uint8_t i=0; i < uidLength; i++) 
    {
      Serial.print(" 0x");Serial.print(uid[i], HEX); 
    }
    Serial.println("");
    // Wait 1 second before continuing
    delay(1000);
  }
  else
  {
    // PN532 probably timed out waiting for a card
    Serial.println("Timed out waiting for a card");
  }
}

No ideas guys?

Did you tried the examples from the NDEF-master.zip?

Hello,

I did, no sucess.

What is weird is that the I2C connection recognize the chip but when trying the SPI connection it fails... So I dunno if it's problem coming from PN532 chip or my arduino which is not compatible maybe...

I'm not familiar with that board so I can't help you further. I noticed it also has a board switch to select which communication protocol should be enabled (I2C, SPI or UART), but I assume you used it as specified in manual.

Hi,

Did you solve this problem already?

I have the same problem.I set up the toggle switch,so my arduino can detect the PN532 module. But the PN532 module couldn't detect my Ultralight C tags...

If you have any updates, please share with us. Thank you.

Same problem-any solutions?