0

PN532 Shield vs. Breakout
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PN532 Shield vs. Breakout

by earp123 on Mon Oct 26, 2020 1:57 pm

Hello!

I'm working on an NFC application using a Dev Kit from Nordic Semi (nRF52840). Since there are nice pre-written examples that use the Adafruit PN532 shield specifically, I was hoping to start there. I've compiled the appropriate micro-ecc libraries and the example compiles just fine, however I'm getting some internal errors after flashing to the board without making any modifications to any of the code. Could this be because I'm using the breakout board rather than the shield? I'm using the default I2C setting (SEL0 and 1 remain open) but after taking a look at the schematic of the breakout, I wonder if there are hardware differences that I should be accommodating with some extra wiring, for example I'm not sure which RESET pin I should be using and the IRQ pin doesn't seem to match the default pin config for the firmware... I've tried connecting these pins and configurations a few different times but still getting internal errors. Wondering if anyone had run into this already? Thanks much!

P.S. I posted a more detailed outline of the errors and some of the debugging I've already managed in the Nordic DevZone forums here >
https://devzone.nordicsemi.com/f/nordic-q-a/67593/fatal-error-in-adafruit_pn532_init

earp123
 
Posts: 14
Joined: Wed May 06, 2015 3:55 pm

Re: PN532 Shield vs. Breakout

by mikeysklar on Tue Oct 27, 2020 2:38 pm

@earp123,

We do have some differences between the Breakout and Shield. Since you are using a nRF52840 be sure and look at the wiring examples on our CircuitPython page (M0 / M4 based) instead of any Arduino examples which will be UNO based. SEL0 = ON and SEL1 = OFF + pullups are needed.

Screen Shot 2020-10-27 at 11.25.29 AM.png
Screen Shot 2020-10-27 at 11.25.29 AM.png (409.15 KiB) Viewed 154 times


https://learn.adafruit.com/adafruit-pn5 ... cuitpython

mikeysklar
 
Posts: 4996
Joined: Mon Aug 01, 2016 8:10 pm

Re: PN532 Shield vs. Breakout

by earp123 on Tue Oct 27, 2020 3:03 pm

Ok I will give this a shot, however the graphic doesn't look like the board I have at all... I have the PN532 Breakout v1.3. It says SEL0 and SEL1 should remain open for I2C right on the board in white letters. Which should I be using?

EDITED: I must apologize, I actually do have the shield and NOT the breakout. So to clarify: Do I need to pull up the SCL and SDA on the shield? And how should I have the SEL jumpers configured for I2C? Again my apologies for the mistake.

earp123
 
Posts: 14
Joined: Wed May 06, 2015 3:55 pm

Re: PN532 Shield vs. Breakout

by earp123 on Tue Oct 27, 2020 4:08 pm

Fun Fact: I don't get any I2C data on a logic analyzer when SEL0 is closed. So I believe the article you've provided on the shield wiring has some misleading information on the configuration, unless I'm missing something.

Still getting an internal fatal error on the output of the board with the example flashed. I sent a logic trace to the Nordic Engineers and they noticed the IRQ pin is not returning LOW in time for the acknowledgement.
Attachments
6471.pastedimage1603826733064v1.png
6471.pastedimage1603826733064v1.png (94.99 KiB) Viewed 153 times

earp123
 
Posts: 14
Joined: Wed May 06, 2015 3:55 pm

Re: PN532 Shield vs. Breakout

by mikeysklar on Wed Oct 28, 2020 10:54 am

The SEL0 and SEL1 are a serious point of confusion. The silkscreen is reversed on the shield!

https://www.adafruit.com/product/789

Please note that there is a minor issue with the current version of the boards (v1.0). SEL0 and SEL1 are reversed on the silkscreen, so SEL0 is actually SEL1 and vice versa. This only affects users who wish to use UART or SPI to communicate with the PN532 instead of the default I2C, which is the communication bus supported by Adafruit's PN532/NFC library for Arduino. This will be update on the next version of the boards.


i2c is the following (you will need to reverse it due to the above note about silkscreen reversal):

SEL0 = ON
SEL1 = OFF

mikeysklar
 
Posts: 4996
Joined: Mon Aug 01, 2016 8:10 pm

Re: PN532 Shield vs. Breakout

by earp123 on Wed Oct 28, 2020 10:59 am

You're still not making much sense here my friend. I was able to capture the I2C trace that I posted (please take a look) with both SEL jumpers open. Then I did close SEL0 and left SEL1 open, and the data trace disappeared. So I really think the silkscreen is correct on the shield v1.3.

earp123
 
Posts: 14
Joined: Wed May 06, 2015 3:55 pm

Re: PN532 Shield vs. Breakout

by mikeysklar on Wed Oct 28, 2020 2:23 pm

Good to know you have the v1.3 of the board and that the i2c data is appearing with SEL0 closed (and I assume SEL1 open). Others have observed the same i2c issues that you are seeing.

To answer your earlier question I don't think pullups are needed or will help. This device has a poor i2c implementation. Can you switch to SPI or UART?

viewtopic.php?f=31&t=65355&p=331307&hilit=PN532+pullup#p331307

mikeysklar
 
Posts: 4996
Joined: Mon Aug 01, 2016 8:10 pm

Re: PN532 Shield vs. Breakout

by earp123 on Wed Oct 28, 2020 2:37 pm

Are you reading anything I post here? There's no i2c data when SEL0 is closed. Trace data only shows up when both are open.

Anyway, the adafruit_pn532.c library does not allow for SPI or UART, only I2c. I really think someone ought to take a look at that library and header file because some of the configuration parameters are definitely incorrect. Especially since your hardware is wrong too.

earp123
 
Posts: 14
Joined: Wed May 06, 2015 3:55 pm

Please be positive and constructive with your questions and comments.