I've got the start of my sketch, which I use on my Arduino Uno successfully, but on the Pico it can't find the PN532 (DFRobot) device and therefore I don't get past the message: "Didn't find PN53x board".
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
#include <NfcAdapter.h>
#include <Ndef.h>
PN532_I2C pn532_i2c(Wire);
PN532 nfc(pn532_i2c);
void setup()
{
Serial.begin(115200);
Serial.println("<-- STARTING -->");
nfc.begin();
uint32_t versiondata = nfc.getFirmwareVersion();
while (! versiondata) {
Serial.print("Didn't find PN53x board");
delay(1000);
}
// 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);
Serial.println("");
// configure board to read RFID tags
nfc.setPassiveActivationRetries(3);
nfc.SAMConfig();
Serial.println("Waiting for a card to be placed on reader.....");
}
void loop() {
// put your main code here, to run repeatedly:
}
At first I had the PN532 clock and data wires connected to the wrong pins (GP2, GP3), but moved them to the right ones (GP6, GP7), and was able to verify the device was "seen" by running the I2C scanner posted by John41234 here: scanner sketch.
I've looked as best as I can through the PN532, PN532Interface, and PN532_I2C libraries the best I can, and I'm not seeing any pin number or constant I should be changing to account for the switch from Arduino to Pico.
I'm using the mbed_rp2040 v.2.5.2 platform.
Any ideas I could use to fix this or test would be greatly appreciated.