title: How can I connect Arduino nano 33 IOT and PN532 module?
body: <p>I am using the example code of readMifare</p>
  <p>This is my code</p>
  <pre><code>`
  #include &lt;Wire.h&gt;
  #include &lt;SPI.h&gt;
  #include &lt;Adafruit_PN532.h&gt;
   
  // If using the breakout with SPI, define the pins for SPI communication.
  #define PN532_SCK  (13)
  #define PN532_MOSI (11)
  #define PN532_SS   (10) // (4) &lt;- changed to D9 for IRQ pin, refer to schematic
  #define PN532_MISO (12)
   
  // If using the breakout or shield with I2C, define just the pins connected
  // to the IRQ and reset lines.  Use the values below (2, 3) for the shield!
  #define PN532_IRQ   (2)
  #define PN532_RESET (3) // Not connected by default on the NFC Shield
   
  // Uncomment just _one_ line below depending on how your breakout or shield
  // is connected to the Arduino:
   
  // Use this line for a breakout with a SPI connection:
   Adafruit_PN532 nfc(PN532_SCK,PN532_MOSI,PN532_MISO,PN532_SS);
   
  // Use this line for a breakout with a hardware SPI connection.  Note that
  // the PN532 SCK, MOSI, and MISO pins need to be connected to the Arduino's
  // hardware SPI SCK, MOSI, and MISO pins.  On an Arduino Uno these are
  // SCK = 13, MOSI = 11, MISO = 12.  The SS line can be any digital IO pin.
  //Adafruit_PN532 nfc(PN532_SS);
  //Adafruit_PN532 nfc(PN532_SCK);
  //Adafruit_PN532 nfc(PN532_MOSI);
  //Adafruit_PN532 nfc(PN532_MISO);
  // Or use this line for a breakout or shield with an I2C connection:
  // Adafruit_PN532 nfc(PN532_IRQ, PN532_RESET);
   
  #if defined(ARDUINO_ARCH_SAMD)
  // for Zero, output on USB Serial console, remove line below if using
  // also change #define in Adafruit_PN532.cpp library file
     #define Serial SerialUSB
  #endif
   
  void setup(void) {
      #ifndef ESP8266
      while (!Serial); // for Leonardo/Micro/Zero
      #endif
   
      /* This PN532 I2C example is modified by DotoriKing from original Adafruit PN532 example */
      Serial.begin(115200);
      Serial.print(&quot;\r\n\r\nPN532 NFC Start by DotoriKing&quot;);
   
      nfc.begin();
   
      uint32_t versiondata = nfc.getFirmwareVersion();
      if (! versiondata)
      {
          Serial.print(&quot;\r\nDidn't find PN53x board&quot;);
          while (1); // halt
      }
   
      // Got ok data, print it out!
      Serial.print(&quot;\r\nFound chip PN5&quot;);
      Serial.print((versiondata&gt;&gt;24) &amp; 0xFF, HEX);
      Serial.print(&quot;\r\nFirmware ver. &quot;);
      Serial.print((versiondata&gt;&gt;16) &amp; 0xFF, DEC);
      Serial.print('.');
      Serial.print((versiondata&gt;&gt;8) &amp; 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.print(&quot;\r\nWaiting for an ISO14443A card&quot;);
  }
   
  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, &amp;uid[0], &amp;uidLength);
   
      if (success)
      {
          Serial.print(&quot;\r\nFound a card!&quot;);
          Serial.print(&quot;\r\nUID Length: &quot;);
          Serial.print(uidLength, DEC);
          Serial.print(&quot; bytes&quot;);
          Serial.print(&quot;\r\nUID Value: &quot;);
   
          for (uint8_t i = 0; i &lt; uidLength; i++)
          {
              Serial.print(&quot; 0x&quot;);
              Serial.print(uid[i], HEX);
          }
   
          // Wait 1 second before continuing
          delay(1000);
      }
      else
      {
          // PN532 probably timed out waiting for a card
          Serial.print(&quot;\r\nTimed out waiting for a card&quot;);
      }
  }
  `
  </code></pre>
  <p>I want to connect the device at SPI setting.</p>
  <p>I have PN532 and BUSIO library. also I connected 3.3V and ground normally and set the PN532 board according to the SPI button.</p>
  <p>but I can only see didn't find PN53x an error message.
  How can I fix the situation?</p>