PN532 I2C and Seeed Xiao nrf52840

I am using the code below to try and read tags. its works fine with Arduino Nano and Arduino Uno.
I am using the PN532 in I2C mode. On the Arduinos I just connect the readers SDA and SCL to A4 and A5 and it works. The reader is the following

On the Xiao nrf52840 I connect to D4 (SDA) and D5 (SCL). The PN532 is not found, do I need to change the code somewhere to tell the nrf52840 which are the SDA and SCL pins. If so how do I do this please?

Code below

#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
PN532_I2C pn532_i2c(Wire);
NfcAdapter nfc = NfcAdapter(pn532_i2c);

/* Uno’s A4 to SDA & A5 to SCL

  • Mega 20 SDA & 21 SCL
    ESP32 normally SDA is 21 SCL is 22
    seeeduino xiao nrf52840 SDA is D4 and SCL is D5

void setup() {


Serial.println("NDEF Reader");



void loop() {


if (nfc.tagPresent()) {
    NfcTag tag =;


Hi, have you selected the exact board from the Arduino IDE’s list of boards?

Yes, I have selected the right board which is Seeed XAIO BLE -nrf52840
The Arduino example sketches and a few others run fine. I am also having trouble getting a I2C 128x128 OLED (SSD1327) to work as well.
I am running version 2.6.1 under board manager. I did try version 1.0.0 but its not making any difference.
If I run the I2C scanner code below it finds the address for the PN532 or OLED so the connection seems fine

#include <Wire.h> //include Wire.h library

void setup()
Wire.begin(); // Wire communication begin
Serial.begin(9600); // The baudrate of Serial monitor is set in 9600
while (!Serial); // Waiting for Serial Monitor
Serial.println("\nI2C Scanner");

void loop()
byte error, address; //variable for error and I2C address
int nDevices;


nDevices = 0;
for (address = 1; address < 127; address++ )
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
error = Wire.endTransmission();

if (error == 0)
  Serial.print("I2C device found at address 0x");
  if (address < 16)
  Serial.print(address, HEX);
  Serial.println("  !");
else if (error == 4)
  Serial.print("Unknown error at address 0x");
  if (address < 16)
  Serial.println(address, HEX);

if (nDevices == 0)
Serial.println(“No I2C devices found\n”);

delay(5000); // wait 5 seconds for the next I2C scan

D4 and D5 are correct based on the variant files, but may want to try A4 and A5 and even plain 4 and 5.

Hello, can you share the LCD code as well?