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
| PN532 | ESP32-P4 |
|---|---|
| MOSI | GPIO28 |
| MISO | GPIO29 |
| SCK | GPIO30 |
| CS | GPIO31 |
| Reset | GPIO2 |
| VCC | 3V3 |
| GND | GND |
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:
IDENTIFIED PN532 IC=0x32 firmware=1.6 support=0x07
identity gate passedThe 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:
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=3This 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/NONEstate- 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.
