Imp005 hardware pin for pn532 IRQ?

I am using PN532 MiFare Library for my NXP pn532 NFC/RFID module with imp005 Breakout.

Problem is always coming as “Error constructing PN532: Message transmission failed”.
Can someone help me with IRQ pin attaching with which hardware PIN?

For Eg:

spi <- hardware.spiBCAD;
ncs <- hardware.pinD;
rstpd_l <- hardware.pinM;
irq <- spi0.pinN; // The problem is coming here

Erm, why are you calling this “spi0.pinN”? Do you mean “hardware.pinN”? That might be more successful.

@hugo Is there any pinout diagram with imp005 and NXP pn532 NFC/RFID?

If we compare:
pn532 ------ Imp005
VCC ---------- 5V
GND ---------- G
SCK ---------- ??? (which pin to attach with)
MISO --------- ??? (which pin to attach with)
MOSI --------- ??? (which pin to attach with)
SS --------- ??? (which pin to attach with)
IRQ--------- ??? (which pin to attach with)
RSTO --------- ??? (which pin to attach with)

Please help?
I have been trying to read/write in NFC module but not able to.

There’s no diagram, no, this is just a SPI peripheral.

SCK goes to SCK/SCLK on a SPI port
MISO goes to MISO on a SPI port
MOSI goes to MOSI in a SPI port
SS goes to CS on a SPI port
IRQ goes to a GPIO
RSTO goes to a GPIO (and may need to be driven inactive for the target device to work)

@hugo By GPIO, do you mean PinE, M, A, B, C, D or which one to be exact?

Also, in PN532MifareClassic Example:

// Label all pins
local spi = hardware.spi0;
local ncs = hardware.?;
local rstpd_l = hardware.?;
local irq = hardware.?;

// Pre-configure SPI bus
spi.configure(? , ?);

Please help what to write for MISO for SPI port? Should I write ncs = hardware.spi0.MISO or something else?

Read the docs. nCS is not a separate pin on imp005, you may need to modify the library to make it work with 005 because of this (or use a totally separate pin for nCS I guess).

@hugo Can you please help me find the exact pins usage for imp005:

local spi = hardware.spi257;
local ncs = hardware.pin1;
local rstpd_l = hardware.pin3;
local irq = hardware.pin4;

spi.configure(LSB_FIRST | CLOCK_IDLE_HIGH, 2000);

Note: This is for imp001, but I want pin configuration for imp005.

@hugo I am using the following configuration and I am getting this error:
"ERROR: Error constructing PN532: Message transmission failed"

The following configuration I am using:

    // Label all pins
    local spi = hardware.spiBCAD;

    // Pre-configure SPI bus
    spi.configure(SIMPLEX_TX | MSB_FIRST | CLOCK_IDLE_LOW, 400);

    local ncs = hardware.pinD;
    local rstpd_l = hardware.pinXA;
    local irq = hardware.pinXC;

You can’t do this with the 005; the hardware itself is only capable of LSB_FIRST mode and I believe the PN532 expects MSB_FIRST, so you will have to bitflip all bytes (both in and out) before you call the spi APIs. You’ll need to modify the library yourself to do this.

If you’re configuring SIMPLEX_TX then you’re telling the device not to receive, so it’s not surprising that it isn’t managing to work.