This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

connecting a PN532 V3 Module to a nRF52840 using SPI. (NFC)

I need to connect a PN532 V3 Module to a nRF52840 using SPI.
I tested it using arduino IDE (I used those three libraries: Adafruit_PN532.h (github.com/.../Adafruit_PN532.h)
, SPI.h and WIRE.h)
and it worked.
So I tried to take those libraries to SEGGER Embedded Studio, but it doesn't work. It seems like I need to convert those libraries from C++ to C.
Is there any other solution?!

Thank you in advance

Parents
  • Hi,

    PN532 is already supported in the SDK through the Adafruit Tag Reader Example. The ported Adafruit driver currently only supports I2C/TWI, but I believe it should be easier to add support for SPI in this driver than to port the full Arduino driver to our SDK yourself.

    Best regards,
    Jørgen

  • SPI scanner example does not really make sense, as multiple SPI slave devices on a single bus are addressed through CS/SS pin, and not through an address on the bus (like it is in I2C/TWI protocols). What you output on the SPI MOSI line from the SPI master will be input to the SPI slave that has its CS/SS pin pulled low by the SPI master. The SPI slave will then process the incoming data and output its response on the MISO line following the clock generated by the master. 

    Using a logic analyzer to look at the lines of the SPI bus is a great tool for debugging issues with communication.

    The Arduino driver will very likely not work with nRF5 SDK without adapting the functions to use the nRF5 SDK SPI drivers, so you will still face the same issue that you are not able to integrate the SPI drivers correctly in the PN532 driver.

Reply
  • SPI scanner example does not really make sense, as multiple SPI slave devices on a single bus are addressed through CS/SS pin, and not through an address on the bus (like it is in I2C/TWI protocols). What you output on the SPI MOSI line from the SPI master will be input to the SPI slave that has its CS/SS pin pulled low by the SPI master. The SPI slave will then process the incoming data and output its response on the MISO line following the clock generated by the master. 

    Using a logic analyzer to look at the lines of the SPI bus is a great tool for debugging issues with communication.

    The Arduino driver will very likely not work with nRF5 SDK without adapting the functions to use the nRF5 SDK SPI drivers, so you will still face the same issue that you are not able to integrate the SPI drivers correctly in the PN532 driver.

Children
No Data
Related