Hello! Does anybody know of a way I can connect the PN532 (RFID/NFC module) to the Arduino Nano 33 Sense in SPI mode? I have all of my prior research and everything surrounding it ready, but I'm stumped on how to get this thing working.
Here's a diagram of wiring setup to the Uno, in SPI mode.
The 33 Sense is SPI compatible, however it is an entirely different board to the regular Nano. Would the difference in processor restrict or change the libraries I can use for card emulation? Would I be able to connect the PN532 to the Nano 33 Sense in the same way, with the same functionality and without causing any damage to the board?
I am using an Arduino Nano 33 Sense (REV2) as a pedometer and sending information to a mobile phone app via the PN532. The data transfer only needs to be half duplex since it's only ever needed to send to the phone - that is why I wanted to use i2c, but it looks like SPI is the only mode that allows for PICC/card emulation. I need PICC since the emulated tag needs to update its NDEF information each loop.
I've been able to establish with help from another hobbyist that I should use 3.3v on the Nano for the PN532 module. Now I need to understand the hardware setup required for card emulation using the Nano and PN532.
This thread (here: Library PN532 for nano 33 ble) looks like it has a solution, but I cannot understand the reason for the change in numbers under Adafruit_SPIDevice fixing the issue.
I did a little prying and found that the "1000000" under the Adafruit_SPIDevice library is BusIOBitOrder; the amount of bits per second (can be considered as 1000 khz or 1 Mhz).
The library doesn't work on the nRF processor without changing this to '100000', possibly since it was originally written for ATmega microcontrollers and not nRF, which uses 100 khz rather than 1 Mhz.
I tried looking through the datasheets for the processor and found no reason for why this change is necessary. Any ideas?
I assumed it was clock speed, but the processor is 64 Mhz, not 1 Mhz? Is SPI speed a thing? I feel like I'm not understanding this on a fundamental level.
I tried to follow this to the letter and it hasn't been detecting the PN532 at all while using the emulate_tag_ndef.ino example from Seeed Studio's library (built from Adafruit's).
Do you have any other suggestions? I find it strange that it compiles but doesn't detect the module. Lots of 'unused variable' and 'redefined variable' warnings appear during compilation but I'm unsure why. Here is a pastebin of the compile: SeedStudio PN532 emulate_tag_ndef.ino - Pastebin.com