PN532 NFC Library [PORTED]

I would use the Adafruit lib that @peekay123 and I worked on:

do you have a link to the one you bought?

Guessing the one at http://www.seeedstudio.com/depot/Grove-NFC-p-1804.html

@elie you wouldnā€™t happen to be at the aws hackday would you? I have been struggling with the NFC all day too!

Yes I am ! Did you get anything going through?

Nope, I have tried on the spark and the edison, no luck on uart or i2cā€¦frsutrating as our whole project relied on itā€¦

Did you get any further?

Looks like youā€™ll have to cut the trace that puts it in UART mode by default, and solder the JUMPER for I2C. If I remember correctly I2C mode works best because you get some added interrupt when a tag is present that you can hook to a digital input
http://www.seeedstudio.com/wiki/Grove_ļ¼_NFC

EDIT: I had this example working for I2C

1 Like

Can you show us a schema of what pin needs to be connected to what port?
That would be really awesome

@lookaflyingdonkey want to come chat?I am on table 13

Yep, gimme a sec here! Got the layout open.

I have tried cutting the jumper, we dont have a soldering iron here (dont askā€¦lol) but I have shorted with a wire I hold on for now.

I will give that a example a go and see if I get any further.

Will pop over @elie

No soldering iron?? You have my sympathy!!!

If you can get it in I2C mode this is the pinout.

The example and library I link above are defaulted to I2C modeā€¦ with this pinout so in theory it should work! Donā€™t forget the way the code is written is for windows, so there is a paused serial terminal. Start your terminal at 115200 baud and press ENTER to start the code running after you power up the Spark Core.

EDIT: Oh and you donā€™t need pull up resistors because they are on that Grove board already.

Thanks a lot for the help!
We could get a card to be read (but not consistently)

1 Like

Thanks, we finally managed to get one of the nfc chips reading but only a phone and not an actual card, and was very sketchy, put it down to the grove and no soldering ironā€¦

Thanks again for your help, at least we were able to get something out of it!

1 Like

Awexome! Yeah thatā€™s better than completely dead in the water :slight_smile: You have something to build on now.

2 Likes

NFC shield: http://www.elecfreaks.com/store/rfidnfc-shield-shdnfc-p-479.html

Hey, are you guys still working on this shield? Just wondering if you had a rough estimate as to when it would be finished/available to buy.

I am currently using a shield shield and this shield. Iā€™ve ported a few libraries but I am still trying to get it working.

Anways, I would definitely prefer to just use something you guys built. NDEF support would be awesome too :slight_smile:

Hi,

I tried out this library and it works great with I2C.

I tried using SPI because I2C doesnā€™t use packets large enough to support Android Beam.

Have you confirmed this working with SPI and if so, what NFC board are you using?

SPI worksā€¦ using the Adafruit PN532 Shield. Just make sure the jumpers are set correctly and you have the right pins connected. If I remember correctly thought the I2C mode is better because it has an interrupt output when a card is scanned vs. the SPI mode where you have to poll continuously looking for a card scan. This might not be a limitation for you though.

Yeah, I am trying to use the Seeed shield and SPI. I canā€™t figure out why it isnā€™t workingā€¦

Anyways, Iā€™ll just try to get everything working over I2C with my Grove board. Thanks.

Alright, I did get SPI working with my shield. I had to wire the pins to the ICSP pins since I was using a shield-shield and those pins arenā€™t set.

Anyways, with this configuration I could get your library to work in SPI mode but only when PN532_HW_SPI was set to 0.

When I was using hardware mode it was failing on the ACK when writing the command to get the firmware.
Iā€™m getting - 0x0 0x0 0xFE 0x0 0xFE 0x0
It should be - 0x0 0x0 0xFF 0x0 0xFF 0x0

Are you using the hardware mode with SPI? Could this be an issue with my hardware? Any ideas on how to proceed using hardware mode?

Thanks

If I remember correctly the software implementation is just as fast as the hardware, so if thatā€™s workingā€¦ go with it. The HW mode might not be working for your shield because of some part of the setup, like which spi mode or MSB/LSB first. Check those against the library vs your shield :smile: