NFC Shield with Interrupt

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
albertms
 
Posts: 4
Joined: Tue Sep 03, 2013 5:28 pm

NFC Shield with Interrupt

Post by albertms »

From the learning page: https://learn.adafruit.com/adafruit-pn5 ... eld-wiring

I2C only uses two pins (Analog 4 and 5 which are fixed in hardware and cannot be changed) to communicate and one pin as an 'interrupt' pin (Digital 2 - can be changed however). […] The Interrupt pin is handy because instead of constantly asking the NFC shield "is there a card in view yet? what about now?" constantly, the chip will alert us when a NFC target comes into the antenna range.

Please give me an example on how to use the interrupt, if it is really possible.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: NFC Shield with Interrupt

Post by Franklin97355 »

The readMifare.pde file in the examples uses it.

User avatar
kariy
 
Posts: 3
Joined: Sun Nov 16, 2014 7:31 pm

Re: NFC Shield with Interrupt

Post by kariy »

I came to these forums looking for examples on how to use the interrupt on your NFC shield and found this thread...
The readMifare.pde file in the examples uses it.
I looked at that file, I don't see any use of interrupts. Can you point me to a specific line in the example you mentioned?

Thank you!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield with Interrupt

Post by adafruit_support_rick »

The library polls the IRQ line. It does not actually use interrupts.

User avatar
kariy
 
Posts: 3
Joined: Sun Nov 16, 2014 7:31 pm

Re: NFC Shield with Interrupt

Post by kariy »

Right, thank you. Can you give me an example of how to use an interrupt with the shield?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield with Interrupt

Post by adafruit_support_rick »

Why do you want an interrupt? What are you going to do with it?

User avatar
kariy
 
Posts: 3
Joined: Sun Nov 16, 2014 7:31 pm

Re: NFC Shield with Interrupt

Post by kariy »

Well I want to be able to handle button presses, so what I wanted to do was each time a button is pressed I could somehow interrupt the busy waiting of the passiveRead method.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: NFC Shield with Interrupt

Post by adafruit_support_rick »

It's easier to just eliminate the timeout on readPassiveTargetID. See this thread:
viewtopic.php?f=31&t=59393&p=300270&hil ... ID#p300270

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”