Grove NFC(I2C)!

Hello Everyone (Scruff :smile:). I finally have modified my grove nfc v1.1. I currently have this code that is compiling and flashing however i keep receiving "Didn't find PN53x board" in my terminal . My grove nfc is connected on I2C_1 on the particle grove shield. Please if someone can figure out how to solve this it would be a great day for me !!!1

This is my following code

#define SYSTEM_THREAD(ENABLED)
#include <Adafruit_PN532.h>
#define PN532_I2C_MODE
// #include <Wire.h>
// #define PN532_MODE (PN532_I2C_MODE)
// #define PN532_READY                         (0x01)
// #define IRQ_PIN  (D0) // This is how the PN532 Shield gets ready status in I2C mode
// #define RST_PIN  (D1) // Necessary for I2C mode

Adafruit_PN532 nfc(D0,D1);


void setup(void) {
  Serial.begin(115200); // Make sure your serial terminal is closed before power the Core.
  
   
  Serial.println("Hello!");

  nfc.begin();

  uint32_t versiondata;
  
  do {
    versiondata = nfc.getFirmwareVersion();
    if (!versiondata) {
      Serial.print("Didn't find PN53x board\n");
      delay(1000);
      Particle.process();
    }
    Particle.process();
    
    
  }while(!versiondata);
  
  

  // Got ok data, print it out!
  Serial.print("Found chip PN5\n"); Serial.println((versiondata>>24) & 0xFF, HEX); 
  Serial.print("Firmware ver. \n"); Serial.print((versiondata>>16) & 0xFF, DEC); 
  Serial.print('.'); Serial.println((versiondata>>8) & 0xFF, DEC);
  
  // configure board to read RFID tags
  nfc.SAMConfig();

}


void loop(void) {

  Particle.process();
  Serial.println("Waiting for an ISO14443A Card ...\n");
  delay(1000);
  
  
  uint8_t 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, &uidLength);
  
  if (success) {
    // Display some basic information about the card
    Serial.println("Found an ISO14443A card");
    Serial.print("  UID Length: ");Serial.print(uidLength, DEC);Serial.println(" bytes");
    Serial.print("  UID Value: ");
    nfc.PrintHex(uid, uidLength);
    
    if (uidLength == 4)
    {
      // We probably have a Mifare Classic card ... 
      uint32_t cardid = uid[0];
      cardid <<= 8;
      cardid |= uid[1];
      cardid <<= 8;
      cardid |= uid[2];  
      cardid <<= 8;
      cardid |= uid[3]; 
      Serial.print("Seems to be a Mifare Classic card #");
      Serial.println(cardid);
    }
    Serial.println("");
 
  }  else {
    Serial.println("nfc.readPassiveTarget Failed\n");
    
    }
}

Scruffr and I discussed a similar issue on a project of mine. I ended up commenting out the pn532 firmware version check and it has been working fine ever since. I am using a different board, but still the pn532 chip.

1 Like

i tried that, this is what happens after:

23%20PM

My suggestion for @Mjones was to copy/paste the library files into the project, then add some Serial.print() statements (e.g. getFirmwareVersion()) to find out what goes wrong inside that (or any other) function.

Also before debugging misbehaving any I2C device itā€™s always advisable to run an I2C scanner to check whether the device can be found at all and which address itā€™s listening on.

If I actually had a Grove NFC board I could test the exact same setup.
When helping out Michael I couldnā€™t reproduce his issue since my NFC board responds the way the library expects but multiple of his boards donā€™t for ā€œobscureā€ reasons.

3 Likes

So my serial monitor cannot find any I2C devices: Scanning... No I2C devices found

Is there a way to solve this? or would this be from my grove board (damageā€¦etc)

Have you set the solder jumper as instructed in the other thread?

Yes,

I canā€™t see the traces between the UART pads cut.
The image in the other thread was for v1.0 but we now see that you have a v1.1

http://wiki.seeedstudio.com/Grove_NFC/#grove-nfc-v11

Okay so basically how does cutting work? i have been looking on it but i cant seem to figure it out

You just take a ordinary cutter knife and cut the trace.
A single deepish cut should be enough, you can check continuity and if you still find the two pads connected, cut again.

You can also look here (a simple google search)
https://learn.sparkfun.com/tutorials/how-to-work-with-jumper-pads-and-pcb-traces/all

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.