# pn532 > This skill provides expert knowledge for interfacing with the PN532 NFC controller. - Author: Mike Schneider - Repository: michschn/claude-plugin-marketplace - Version: 20260116223758 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/michschn/claude-plugin-marketplace - Web: https://mule.run/skillshub/@@michschn/claude-plugin-marketplace~pn532:20260116223758 --- # PN532 NFC Controller Skill This skill provides expert knowledge for interfacing with the PN532 NFC controller. ## Activation Triggers Activate this skill when the context includes: - Code with PN532 references (class names, defines, includes) - NFC/RFID communication code patterns - Frame construction matching PN532 format (0x00 0x00 0xFF preamble) - Commands like InListPassiveTarget, InDataExchange, SAMConfiguration - I2C address 0x24 or 0x48 in NFC context - ISO14443, MIFARE, FeliCa, NDEF protocol handling ## Keyword Detection - `pn532`, `PN532` - `InListPassiveTarget`, `InDataExchange`, `SAMConfiguration` - `0xD4` (host to PN532 TFI) - `MIFARE`, `ISO14443`, `FeliCa`, `NFCIP` - `NFC_`, `nfc_`, `Nfc` combined with read/write/poll/detect ## Knowledge Base If `knowledge/overview.md` exists, it contains: - Complete command reference with byte formats - Register map and configuration options - Protocol-specific sequences - Timing specifications - Error code definitions Reference this for accurate details. If it doesn't exist but PDFs are in `knowledge/`, suggest `/pn532-init-docs`. ## Proactive Behaviors ### Frame Construction When seeing manual frame building, verify: - Preamble: 0x00 0x00 0xFF - LCS = ~LEN + 1 (two's complement) - DCS = ~(sum of TFI + DATA) + 1 - Postamble: 0x00 Flag if checksums appear incorrect. ### Command Sequences Suggest proper sequences: - Reset → SAMConfiguration before any card operations - InListPassiveTarget → InDataExchange for card communication - Authentication before protected MIFARE sectors ### Common Anti-Patterns | Pattern | Issue | Suggestion | |---------|-------|------------| | No ACK check after command | May miss errors | Always verify ACK before reading response | | Fixed delays instead of IRQ/ready | Inefficient, unreliable | Use interrupt or poll ready signal | | Ignoring error byte in response | Silent failures | Check byte after response code | | No timeout on card operations | Can hang forever | Set appropriate RFConfiguration timeouts | | RF field always on | Wastes power, heats antenna | Disable between operations if battery powered | ### Interface-Specific Guidance **I2C Mode:** - Poll ready bit or use IRQ line - Handle clock stretching - Use repeated start for read after write **SPI Mode:** - Status read before data read - Watch for busy flag - Proper SS timing **HSU Mode:** - Wake up with extended preamble if sleeping - Handle baud rate configuration - Watch for frame sync issues ## Response Style When activated: 1. Acknowledge the PN532 context 2. Reference documentation when providing specific values 3. Show complete frame examples with all bytes 4. Highlight timing-critical operations 5. Suggest the `/pn532-*` commands for deeper analysis