Docs menu

Engineering Reference · PHYSICALLY PROVEN / CLOSED

PN532 software-SPI wiring, identity, ISO14443A polling, UID reading, removal and logical de-duplication proof.

Hardware Example 03 — SPI NFC/RFID

Device Console: After flashing, use MONITOR for PN532 identity, polling, UID, removal, and de-duplication output. The current read-only I/O parser does not interpret PN532/SPI/NFC messages, so MONITOR remains the expected view for this example.

Status: PHYSICALLY PROVEN / CLOSED — 2026-08-08

Target: Waveshare ESP32-P4-WIFI6-Touch-LCD-7B with Elechouse PN532 NFC Module V3.

In Studio, use Load Example to replace the current project and Guide for concise wiring and test instructions. After flashing, present a compatible ISO14443A tag, remove it, and present it again to verify UID stability, removal and one logical count per presentation.

Wiring

PN532ESP32-P4
MOSIGPIO28
MISOGPIO29
SCKGPIO30
CSGPIO31
ResetGPIO2
VCC3V3
GNDGND

IRQ is not required. Example selection is exclusive; GPIO2 is available because Example 01 is not compiled or initialized when Example 03 is selected.

Physically proven evidence

After reseating the physical connections, the software-SPI identity gate returned:

text
IDENTIFIED PN532 IC=0x32 firmware=1.6 support=0x07
identity gate passed

The implementation preserves the proven software-SPI path: mode 0, LSB-first, CS idle high, and a reset pulse of high 2 ms, low 10 ms, high 10 ms. The initial firmware query is retried once after 25 ms.

The real ESP32-P4 subsequently produced:

text
CARD PRESENT UID=04:8D:E6:5F:B7:2A:81 logical_read=1
CARD NONE
CARD PRESENT UID=04:8D:E6:5F:B7:2A:81 logical_read=2
CARD NONE
CARD PRESENT UID=04:8D:E6:5F:B7:2A:81 logical_read=3

This physically proves PN532 identity, SAMConfig, ISO14443A polling, real tag detection, stable UID reads, removal detection, same-UID re-presentation and held-card de-duplication with one logical increment per presentation.

Proven behavior

  • SAMConfig
  • ISO14443A passive polling
  • colon-separated uppercase UID display
  • PRESENT / NONE state
  • logical read count
  • held-card de-duplication

The proof is closed. Do not change the proven runtime protocol while performing documentation maintenance. GPIO28–GPIO31 and GPIO2 are allocated to the PN532 only while Example 03 is selected; IRQ remains unused. Unselected examples keep their standalone implementation files but do not link, initialize, poll, or own these pins.